@marko/vite 4.1.0 → 4.1.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.
- package/dist/index.mjs +15 -9
- package/package.json +26 -26
package/dist/index.mjs
CHANGED
|
@@ -643,6 +643,7 @@ var POSIX_SEP = "/";
|
|
|
643
643
|
var WINDOWS_SEP = "\\";
|
|
644
644
|
var normalizePath = path5.sep === WINDOWS_SEP ? (id) => id.replace(/\\/g, POSIX_SEP) : (id) => id;
|
|
645
645
|
var virtualFiles = /* @__PURE__ */ new Map();
|
|
646
|
+
var extReg = /\.[^.]+$/;
|
|
646
647
|
var queryReg = /\?marko-[^?]+$/;
|
|
647
648
|
var browserEntryQuery = "?marko-browser-entry";
|
|
648
649
|
var serverEntryQuery = "?marko-server-entry";
|
|
@@ -776,12 +777,15 @@ function markoPlugin(opts = {}) {
|
|
|
776
777
|
});
|
|
777
778
|
if (isTest) {
|
|
778
779
|
linked = false;
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
)) {
|
|
780
|
+
const { test } = config;
|
|
781
|
+
if (test.environment?.includes("dom")) {
|
|
782
782
|
config.resolve ??= {};
|
|
783
783
|
config.resolve.conditions ??= [];
|
|
784
784
|
config.resolve.conditions.push("browser");
|
|
785
|
+
test.deps ??= {};
|
|
786
|
+
test.optimizer ??= {};
|
|
787
|
+
test.optimizer.web ??= {};
|
|
788
|
+
test.optimizer.web.enabled ??= true;
|
|
785
789
|
}
|
|
786
790
|
}
|
|
787
791
|
if (!registeredTagLib) {
|
|
@@ -807,17 +811,17 @@ function markoPlugin(opts = {}) {
|
|
|
807
811
|
const esbuildPlugins = esbuildOptions.plugins ??= [];
|
|
808
812
|
esbuildPlugins.push(esbuildPlugin(compiler, baseConfig));
|
|
809
813
|
const ssr = config.ssr ??= {};
|
|
810
|
-
|
|
814
|
+
const { noExternal } = ssr;
|
|
811
815
|
if (noExternal !== true) {
|
|
812
816
|
const noExternalReg = /\.marko$/;
|
|
813
817
|
if (noExternal) {
|
|
814
818
|
if (Array.isArray(noExternal)) {
|
|
815
|
-
noExternal
|
|
819
|
+
ssr.noExternal = [...noExternal, noExternalReg];
|
|
816
820
|
} else {
|
|
817
|
-
noExternal = [noExternal, noExternalReg];
|
|
821
|
+
ssr.noExternal = [noExternal, noExternalReg];
|
|
818
822
|
}
|
|
819
823
|
} else {
|
|
820
|
-
noExternal = noExternalReg;
|
|
824
|
+
ssr.noExternal = noExternalReg;
|
|
821
825
|
}
|
|
822
826
|
}
|
|
823
827
|
if (basePathVar) {
|
|
@@ -1005,8 +1009,10 @@ function markoPlugin(opts = {}) {
|
|
|
1005
1009
|
async transform(source, rawId, ssr) {
|
|
1006
1010
|
let id = stripVersionAndTimeStamp(rawId);
|
|
1007
1011
|
const info = isBuild ? this.getModuleInfo(id) : void 0;
|
|
1008
|
-
|
|
1009
|
-
|
|
1012
|
+
const arcSourceId = info?.meta.arcSourceId;
|
|
1013
|
+
if (arcSourceId) {
|
|
1014
|
+
const arcFlagSet = info.meta.arcFlagSet;
|
|
1015
|
+
id = arcFlagSet ? arcSourceId.replace(extReg, `[${arcFlagSet.join("+")}]$&`) : arcSourceId;
|
|
1010
1016
|
}
|
|
1011
1017
|
const isSSR = typeof ssr === "object" ? ssr.ssr : ssr;
|
|
1012
1018
|
const query = getMarkoQuery(id);
|
package/package.json
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marko/vite",
|
|
3
3
|
"description": "A Marko plugin for Vite",
|
|
4
|
-
"version": "4.1.
|
|
4
|
+
"version": "4.1.2",
|
|
5
5
|
"author": "Dylan Piercey <dpiercey@ebay.com>",
|
|
6
6
|
"bugs": "https://github.com/marko-js/vite/issues",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"anymatch": "^3.1.3",
|
|
9
9
|
"domelementtype": "^2.3.0",
|
|
10
10
|
"domhandler": "^5.0.3",
|
|
11
|
-
"htmlparser2": "^9.
|
|
11
|
+
"htmlparser2": "^9.1.0",
|
|
12
12
|
"resolve": "^1.22.8",
|
|
13
13
|
"resolve.exports": "^2.0.2"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@changesets/changelog-github": "^0.
|
|
17
|
-
"@changesets/cli": "^2.
|
|
18
|
-
"@marko/compiler": "^5.
|
|
16
|
+
"@changesets/changelog-github": "^0.5.0",
|
|
17
|
+
"@changesets/cli": "^2.27.1",
|
|
18
|
+
"@marko/compiler": "^5.34.7",
|
|
19
19
|
"@marko/fixture-snapshots": "^2.2.1",
|
|
20
|
-
"@marko/testing-library": "^6.
|
|
21
|
-
"@types/babel__core": "^7.20.
|
|
22
|
-
"@types/jsdom": "^21.1.
|
|
23
|
-
"@types/mocha": "^10.0.
|
|
24
|
-
"@types/node": "^20.
|
|
25
|
-
"@types/resolve": "^1.20.
|
|
20
|
+
"@marko/testing-library": "^6.2.0",
|
|
21
|
+
"@types/babel__core": "^7.20.5",
|
|
22
|
+
"@types/jsdom": "^21.1.6",
|
|
23
|
+
"@types/mocha": "^10.0.6",
|
|
24
|
+
"@types/node": "^20.11.20",
|
|
25
|
+
"@types/resolve": "^1.20.6",
|
|
26
26
|
"@types/serve-handler": "^6.1.4",
|
|
27
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
28
|
-
"@typescript-eslint/parser": "^
|
|
27
|
+
"@typescript-eslint/eslint-plugin": "^7.1.0",
|
|
28
|
+
"@typescript-eslint/parser": "^7.1.0",
|
|
29
29
|
"cross-env": "^7.0.3",
|
|
30
|
-
"esbuild": "^0.
|
|
31
|
-
"eslint": "^8.
|
|
32
|
-
"eslint-config-prettier": "^9.
|
|
30
|
+
"esbuild": "^0.20.1",
|
|
31
|
+
"eslint": "^8.57.0",
|
|
32
|
+
"eslint-config-prettier": "^9.1.0",
|
|
33
33
|
"fixpack": "^4.0.0",
|
|
34
|
-
"husky": "^
|
|
35
|
-
"jsdom": "^
|
|
36
|
-
"lint-staged": "^15.
|
|
37
|
-
"marko": "^5.
|
|
38
|
-
"mocha": "^10.
|
|
34
|
+
"husky": "^9.0.11",
|
|
35
|
+
"jsdom": "^24.0.0",
|
|
36
|
+
"lint-staged": "^15.2.2",
|
|
37
|
+
"marko": "^5.32.13",
|
|
38
|
+
"mocha": "^10.3.0",
|
|
39
39
|
"mocha-snap": "^5.0.0",
|
|
40
40
|
"nyc": "^15.1.0",
|
|
41
|
-
"playwright": "^1.
|
|
42
|
-
"prettier": "^3.
|
|
41
|
+
"playwright": "^1.41.2",
|
|
42
|
+
"prettier": "^3.2.5",
|
|
43
43
|
"serve-handler": "^6.1.5",
|
|
44
|
-
"tsx": "^4.1
|
|
45
|
-
"typescript": "^5.
|
|
46
|
-
"vite": "^5.
|
|
44
|
+
"tsx": "^4.7.1",
|
|
45
|
+
"typescript": "^5.3.3",
|
|
46
|
+
"vite": "^5.1.4"
|
|
47
47
|
},
|
|
48
48
|
"files": [
|
|
49
49
|
"dist",
|