@svelte-vitals/vite 0.29.1 → 0.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,6 +3,29 @@ import { parse } from "node-html-parser";
|
|
|
3
3
|
function attrValue(v) {
|
|
4
4
|
return v !== void 0 && v.trim().length > 0 ? "static" : "absent";
|
|
5
5
|
}
|
|
6
|
+
var JS_MIME_TYPES = /* @__PURE__ */ new Set([
|
|
7
|
+
"application/ecmascript",
|
|
8
|
+
"application/javascript",
|
|
9
|
+
"application/x-ecmascript",
|
|
10
|
+
"application/x-javascript",
|
|
11
|
+
"text/ecmascript",
|
|
12
|
+
"text/javascript",
|
|
13
|
+
"text/javascript1.0",
|
|
14
|
+
"text/javascript1.1",
|
|
15
|
+
"text/javascript1.2",
|
|
16
|
+
"text/javascript1.3",
|
|
17
|
+
"text/javascript1.4",
|
|
18
|
+
"text/javascript1.5",
|
|
19
|
+
"text/jscript",
|
|
20
|
+
"text/livescript",
|
|
21
|
+
"text/x-ecmascript",
|
|
22
|
+
"text/x-javascript"
|
|
23
|
+
]);
|
|
24
|
+
function isClassicScriptType(type) {
|
|
25
|
+
if (type === void 0) return true;
|
|
26
|
+
const normalized = type.trim().toLowerCase();
|
|
27
|
+
return normalized === "" || JS_MIME_TYPES.has(normalized);
|
|
28
|
+
}
|
|
6
29
|
function parseHtmlHead(html) {
|
|
7
30
|
const root = parse(html);
|
|
8
31
|
const head = root.querySelector("head") ?? root;
|
|
@@ -72,7 +95,7 @@ function parseHtmlHead(html) {
|
|
|
72
95
|
}
|
|
73
96
|
const src = script.getAttribute("src");
|
|
74
97
|
if (src) {
|
|
75
|
-
const blocking = !script.hasAttribute("defer") && !script.hasAttribute("async")
|
|
98
|
+
const blocking = isClassicScriptType(type) && !script.hasAttribute("defer") && !script.hasAttribute("async");
|
|
76
99
|
tags.push({
|
|
77
100
|
kind: "script",
|
|
78
101
|
presence: "own",
|
package/dist/hooks/index.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svelte-vitals/vite",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.2",
|
|
4
4
|
"description": "Vite/SvelteKit plugin for svelte-vitals — analyzes prerendered HTML during vite build, plus a live dev dashboard.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"esm-env": "^1.2.2",
|
|
43
43
|
"node-html-parser": "^9.0.1",
|
|
44
44
|
"tinyglobby": "^0.2.17",
|
|
45
|
-
"
|
|
46
|
-
"svelte-vitals": "0.
|
|
45
|
+
"svelte-vitals": "0.44.2",
|
|
46
|
+
"@svelte-vitals/core": "0.40.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@sveltejs/kit": "^2.70.2",
|