@marko/vite 5.2.0 → 5.2.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/glob-import-transform.d.ts +1 -1
- package/dist/index.mjs +14 -11
- package/package.json +15 -14
package/dist/index.mjs
CHANGED
|
@@ -244,6 +244,7 @@ function esbuildPlugin(config) {
|
|
|
244
244
|
import { types as t2 } from "@marko/compiler";
|
|
245
245
|
import glob from "fast-glob";
|
|
246
246
|
import path3 from "path";
|
|
247
|
+
import { relativeImportPath } from "relative-import-path";
|
|
247
248
|
var programGlobImports = /* @__PURE__ */ new WeakMap();
|
|
248
249
|
var glob_import_transform_default = {
|
|
249
250
|
MetaProperty(tag) {
|
|
@@ -265,18 +266,17 @@ var glob_import_transform_default = {
|
|
|
265
266
|
}
|
|
266
267
|
},
|
|
267
268
|
Program: {
|
|
268
|
-
exit(
|
|
269
|
-
const globImports = programGlobImports.get(
|
|
269
|
+
exit(program) {
|
|
270
|
+
const globImports = programGlobImports.get(program);
|
|
270
271
|
if (!globImports) {
|
|
271
272
|
return;
|
|
272
273
|
}
|
|
273
|
-
const { cwd, filename } =
|
|
274
|
+
const { cwd, filename } = program.hub.file.opts;
|
|
274
275
|
const dir = path3.dirname(filename);
|
|
275
276
|
const seen = /* @__PURE__ */ new Set();
|
|
276
277
|
for (const [patterns, options] of globImports) {
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
cwd,
|
|
278
|
+
const results = glob.globSync(patterns, {
|
|
279
|
+
cwd: dir,
|
|
280
280
|
absolute: true,
|
|
281
281
|
dot: !!options.exhaustive,
|
|
282
282
|
ignore: options.exhaustive ? [] : [path3.join(cwd, "**/node_modules/**")]
|
|
@@ -284,7 +284,12 @@ var glob_import_transform_default = {
|
|
|
284
284
|
for (const file of results) {
|
|
285
285
|
if (file.endsWith(".marko") && file !== filename && !seen.has(file)) {
|
|
286
286
|
seen.add(file);
|
|
287
|
-
|
|
287
|
+
program.node.body.push(
|
|
288
|
+
t2.importDeclaration(
|
|
289
|
+
[],
|
|
290
|
+
t2.stringLiteral(relativeImportPath(filename, file))
|
|
291
|
+
)
|
|
292
|
+
);
|
|
288
293
|
}
|
|
289
294
|
}
|
|
290
295
|
}
|
|
@@ -737,8 +742,7 @@ static function flush($global, html) {
|
|
|
737
742
|
static function setFlush($global) {
|
|
738
743
|
$global.__flush__ = flush;
|
|
739
744
|
}
|
|
740
|
-
|
|
741
|
-
<const/writeSync=addAssets($global, assets) || setFlush($global)/>
|
|
745
|
+
<const/writeSync=addAssets($global, [${opts.entryData.join(",")}]) || setFlush($global)/>
|
|
742
746
|
-- $!{writeSync && getPrepend($global)}
|
|
743
747
|
<Template ...input/>
|
|
744
748
|
-- $!{writeSync && getAppend($global)}
|
|
@@ -747,8 +751,7 @@ static const assets = [${opts.entryData.join(",")}];
|
|
|
747
751
|
return `import template from ${fileNameStr};
|
|
748
752
|
export * from ${fileNameStr};
|
|
749
753
|
import { addAssets, getPrepend, getAppend } from "${renderAssetsRuntimeId}";
|
|
750
|
-
|
|
751
|
-
<if(addAssets($global, assets))>
|
|
754
|
+
<if(addAssets($global, [${opts.entryData.join(",")}]))>
|
|
752
755
|
$!{getPrepend($global)}
|
|
753
756
|
<\${template} ...input/>
|
|
754
757
|
$!{getAppend($global)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marko/vite",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.1",
|
|
4
4
|
"description": "A Marko plugin for Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"loader",
|
|
@@ -47,46 +47,47 @@
|
|
|
47
47
|
"domhandler": "^5.0.3",
|
|
48
48
|
"fast-glob": "^3.3.3",
|
|
49
49
|
"htmlparser2": "^10.0.0",
|
|
50
|
+
"relative-import-path": "^1.0.0",
|
|
50
51
|
"resolve": "^1.22.10",
|
|
51
52
|
"resolve.exports": "^2.0.3"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
|
54
55
|
"@changesets/changelog-github": "^0.5.1",
|
|
55
56
|
"@changesets/cli": "^2.29.5",
|
|
56
|
-
"@eslint/js": "^9.
|
|
57
|
-
"@marko/compiler": "^5.39.
|
|
57
|
+
"@eslint/js": "^9.31.0",
|
|
58
|
+
"@marko/compiler": "^5.39.29",
|
|
58
59
|
"@marko/fixture-snapshots": "^2.2.1",
|
|
59
|
-
"@marko/testing-library": "^6.
|
|
60
|
+
"@marko/testing-library": "^6.3.1",
|
|
60
61
|
"@types/babel__core": "^7.20.5",
|
|
61
62
|
"@types/diff": "^8.0.0",
|
|
62
63
|
"@types/jsdom": "^21.1.7",
|
|
63
64
|
"@types/mocha": "^10.0.10",
|
|
64
|
-
"@types/node": "^24.0.
|
|
65
|
+
"@types/node": "^24.0.14",
|
|
65
66
|
"@types/resolve": "^1.20.6",
|
|
66
67
|
"@types/serve-handler": "^6.1.4",
|
|
67
68
|
"cross-env": "^7.0.3",
|
|
68
69
|
"diff": "^8.0.2",
|
|
69
|
-
"esbuild": "^0.25.
|
|
70
|
-
"eslint": "^9.
|
|
70
|
+
"esbuild": "^0.25.6",
|
|
71
|
+
"eslint": "^9.31.0",
|
|
71
72
|
"eslint-formatter-unix": "^8.40.0",
|
|
72
73
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
73
|
-
"globals": "^16.
|
|
74
|
+
"globals": "^16.3.0",
|
|
74
75
|
"husky": "^9.1.7",
|
|
75
76
|
"jsdom": "^26.1.0",
|
|
76
77
|
"less": "^4.3.0",
|
|
77
78
|
"lint-staged": "^16.1.2",
|
|
78
|
-
"marko": "^5.37.
|
|
79
|
+
"marko": "^5.37.41",
|
|
79
80
|
"mocha": "^11.7.1",
|
|
80
81
|
"mocha-snap": "^5.0.0",
|
|
81
82
|
"nyc": "^17.1.0",
|
|
82
|
-
"playwright": "^1.
|
|
83
|
-
"prettier": "^3.6.
|
|
84
|
-
"prettier-plugin-packagejson": "^2.5.
|
|
83
|
+
"playwright": "^1.54.1",
|
|
84
|
+
"prettier": "^3.6.2",
|
|
85
|
+
"prettier-plugin-packagejson": "^2.5.18",
|
|
85
86
|
"serve-handler": "^6.1.6",
|
|
86
87
|
"tsx": "^4.20.3",
|
|
87
88
|
"typescript": "^5.8.3",
|
|
88
|
-
"typescript-eslint": "^8.
|
|
89
|
-
"vite": "^7.0.
|
|
89
|
+
"typescript-eslint": "^8.37.0",
|
|
90
|
+
"vite": "^7.0.4"
|
|
90
91
|
},
|
|
91
92
|
"peerDependencies": {
|
|
92
93
|
"@marko/compiler": "^5",
|