-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
54 lines (50 loc) · 1.97 KB
/
index.html
File metadata and controls
54 lines (50 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!doctype html>
<html lang="en" class="dark">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Scripta</title>
</head>
<body>
<div id="root"></div>
<!--
Console log suppression.
This IIFE intercepts specific console methods and filters out noisy
messages by prefix before the Vite pre-bundled chunks run.
Suppressed messages:
- "linkifyjs: already initialized" (console.warn)
See: https://github.com/ueberdosis/tiptap/issues/5450
- "[vite]" (console.debug)
Vite client-side debug logs that are not useful in production builds.
NOTE: This script must appear BEFORE the main application module
(<script type="module">) so that the console overrides are in place
before any library code captures a reference to the original methods.
-->
<script>
(() => {
/**
* Replaces a console method with a filtered version that silently
* drops messages whose first argument starts with the given prefix.
*
* @param {keyof Pick<Console, 'warn'|'debug'|'log'|'info'>} method
* - The name of the console method to override.
* @param {string} prefix
* - The message prefix to match. Any call whose first argument is a
* string beginning with this value will be suppressed.
*/
const suppress = (method, prefix) => {
const original = console[method];
console[method] = (...args) => {
const msg = typeof args[0] === "string" ? args[0] : "";
if (msg.startsWith(prefix)) return;
original.apply(console, args);
};
};
suppress("warn", "linkifyjs: already initialized");
suppress("debug", "[vite]");
})();
</script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>