@marko/vite 2.4.0 → 2.4.1
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.
- package/dist/{chunk-U7T7RXXE.mjs → chunk-6IJ5UJ3N.mjs} +5 -1
- package/dist/{chunk-SELVH7LO.mjs → chunk-BV667Z5U.mjs} +2 -2
- package/dist/{chunk-FHYNYHDA.mjs → chunk-ZCKVZIQN.mjs} +1 -1
- package/dist/components/vite.marko +5 -7
- package/dist/index.mjs +3 -3
- package/dist/manifest-generator.mjs +2 -2
- package/dist/serializer.js +2 -2
- package/dist/serializer.mjs +1 -1
- package/dist/server-entry-template.js +5 -1
- package/dist/server-entry-template.mjs +1 -1
- package/package.json +2 -2
|
@@ -9,7 +9,11 @@ ${opts.basePathVar ? `
|
|
|
9
9
|
static if (typeof ${opts.basePathVar} !== "string") throw new Error("${opts.basePathVar} must be defined when using basePathVar.");
|
|
10
10
|
static if (!${opts.basePathVar}.endsWith("/")) throw new Error("${opts.basePathVar} must end with a '/' when using basePathVar.");
|
|
11
11
|
` : ""}${opts.runtimeId ? `$ out.global.runtimeId = ${JSON.stringify(opts.runtimeId)};
|
|
12
|
-
|
|
12
|
+
$ out.global.___viteBaseVar = ${JSON.stringify(
|
|
13
|
+
"$mbp_" + opts.runtimeId
|
|
14
|
+
)};
|
|
15
|
+
` : `$ out.global.___viteBaseVar = "$mbp";
|
|
16
|
+
`}$ (out.global.___viteEntries || (out.global.___viteEntries = [])).push(${opts.entryData});
|
|
13
17
|
<_vite${base} slot="head-prepend"/>
|
|
14
18
|
<_vite${base} slot="head"/>
|
|
15
19
|
<_vite${base} slot="body-prepend"/>
|
|
@@ -39,8 +39,8 @@ function serialize(basePath, nodes, parts) {
|
|
|
39
39
|
curString = "";
|
|
40
40
|
break;
|
|
41
41
|
case "link":
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
urlAttr = "href";
|
|
43
|
+
if (tag.attribs.rel === "stylesheet" || tag.attribs.rel === "modulepreload" || tag.attribs.as === "style" || tag.attribs.as === "script") {
|
|
44
44
|
parts.push(curString, 0 /* AssetAttrs */);
|
|
45
45
|
curString = "";
|
|
46
46
|
}
|
|
@@ -34,15 +34,13 @@ $ if (!out.global.___viteRenderAssets) {
|
|
|
34
34
|
? ` nonce="${out.global.cspNonce.replace(/"/g, "'")}"`
|
|
35
35
|
: "";
|
|
36
36
|
out.global.___viteRenderAssets = renderAssets;
|
|
37
|
-
|
|
38
|
-
if (input.base) {
|
|
39
|
-
out.global.___viteBasePath = input.base;
|
|
40
|
-
out.script(`$mbp${out.global.runtimeId ? `_${out.global.runtimeId}` : ""}=${JSON.stringify(input.base)}`);
|
|
41
|
-
} else {
|
|
42
|
-
out.global.___viteBasePath = import.meta.env.BASE_URL;
|
|
43
|
-
}
|
|
37
|
+
out.global.___viteBasePath = input.base || import.meta.env.BASE_URL;
|
|
44
38
|
}
|
|
45
39
|
|
|
46
40
|
<__flush_here_and_after__>
|
|
41
|
+
<if(input.base && !out.global.___flushedMBP)>
|
|
42
|
+
$ out.global.___flushedMBP = true;
|
|
43
|
+
$!{`<script${out.global.___viteInjectAttrs}>${out.global.___viteBaseVar}=${JSON.stringify(input.base)}</script>`}
|
|
44
|
+
</if>
|
|
47
45
|
$!{out.global.___viteRenderAssets(input.slot)}
|
|
48
46
|
</__flush_here_and_after__>
|
package/dist/index.mjs
CHANGED
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
generateDocManifest,
|
|
6
6
|
generateInputDoc
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-ZCKVZIQN.mjs";
|
|
8
|
+
import "./chunk-BV667Z5U.mjs";
|
|
9
9
|
import {
|
|
10
10
|
server_entry_template_default
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6IJ5UJ3N.mjs";
|
|
12
12
|
import "./chunk-KIYHBIE6.mjs";
|
|
13
13
|
import {
|
|
14
14
|
MemoryStore
|
package/dist/serializer.js
CHANGED
|
@@ -66,8 +66,8 @@ function serialize(basePath, nodes, parts) {
|
|
|
66
66
|
curString = "";
|
|
67
67
|
break;
|
|
68
68
|
case "link":
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
urlAttr = "href";
|
|
70
|
+
if (tag.attribs.rel === "stylesheet" || tag.attribs.rel === "modulepreload" || tag.attribs.as === "style" || tag.attribs.as === "script") {
|
|
71
71
|
parts.push(curString, 0 /* AssetAttrs */);
|
|
72
72
|
curString = "";
|
|
73
73
|
}
|
package/dist/serializer.mjs
CHANGED
|
@@ -41,7 +41,11 @@ ${opts.basePathVar ? `
|
|
|
41
41
|
static if (typeof ${opts.basePathVar} !== "string") throw new Error("${opts.basePathVar} must be defined when using basePathVar.");
|
|
42
42
|
static if (!${opts.basePathVar}.endsWith("/")) throw new Error("${opts.basePathVar} must end with a '/' when using basePathVar.");
|
|
43
43
|
` : ""}${opts.runtimeId ? `$ out.global.runtimeId = ${JSON.stringify(opts.runtimeId)};
|
|
44
|
-
|
|
44
|
+
$ out.global.___viteBaseVar = ${JSON.stringify(
|
|
45
|
+
"$mbp_" + opts.runtimeId
|
|
46
|
+
)};
|
|
47
|
+
` : `$ out.global.___viteBaseVar = "$mbp";
|
|
48
|
+
`}$ (out.global.___viteEntries || (out.global.___viteEntries = [])).push(${opts.entryData});
|
|
45
49
|
<_vite${base} slot="head-prepend"/>
|
|
46
50
|
<_vite${base} slot="head"/>
|
|
47
51
|
<_vite${base} slot="body-prepend"/>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marko/vite",
|
|
3
3
|
"description": "A Marko plugin for Vite",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.1",
|
|
5
5
|
"author": "Dylan Piercey <dpiercey@ebay.com>",
|
|
6
6
|
"bugs": "https://github.com/marko-js/vite/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"lint-staged": "^13.1.0",
|
|
35
35
|
"marko": "^5.22.0",
|
|
36
36
|
"mocha": "^10.2.0",
|
|
37
|
-
"mocha-snap": "^
|
|
37
|
+
"mocha-snap": "^5.0.0",
|
|
38
38
|
"nyc": "^15.1.0",
|
|
39
39
|
"playwright": "^1.29.1",
|
|
40
40
|
"prettier": "^2.8.1",
|