@marko/vite 5.1.4 → 5.1.6

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.
Files changed (2) hide show
  1. package/dist/index.mjs +10 -24
  2. package/package.json +26 -26
package/dist/index.mjs CHANGED
@@ -169,14 +169,9 @@ function esbuildPlugin(config) {
169
169
  const isScan = build.initialOptions.plugins?.some(
170
170
  (v) => v.name === "vite:dep-scan"
171
171
  );
172
- const virtualFiles2 = /* @__PURE__ */ new Map();
173
172
  const finalConfig = {
174
173
  ...config,
175
- output: platform === "browser" ? "dom" : "html",
176
- resolveVirtualDependency(from, dep) {
177
- virtualFiles2.set(path2.join(from, "..", dep.virtualPath), dep);
178
- return dep.virtualPath;
179
- }
174
+ output: platform === "browser" ? "dom" : "html"
180
175
  };
181
176
  const scanConfig = {
182
177
  ...finalConfig,
@@ -184,18 +179,10 @@ function esbuildPlugin(config) {
184
179
  };
185
180
  build.onResolve({ filter: /\.marko\./ }, (args) => {
186
181
  return {
187
- namespace: "marko:virtual",
188
182
  path: path2.resolve(args.resolveDir, args.path),
189
- external: isScan
183
+ external: true
190
184
  };
191
185
  });
192
- build.onLoad(
193
- { filter: /\.marko\./, namespace: "marko:virtual" },
194
- (args) => ({
195
- contents: virtualFiles2.get(args.path).code,
196
- loader: path2.extname(args.path).slice(1)
197
- })
198
- );
199
186
  build.onLoad({ filter: /\.marko$/ }, async (args) => {
200
187
  try {
201
188
  const { code, meta } = await compiler.compileFile(
@@ -651,18 +638,19 @@ function renderAssets(slot) {
651
638
  // To avoid FOUC we will hide the page until all of these modules are loaded.
652
639
  const { preload } = entry;
653
640
  if (preload) {
641
+ let sep = "";
642
+ html += \`<style marko-vite-preload\${this.___viteInjectAttrs}>html{visibility:hidden !important}</style>\`;
654
643
  html += \`<script marko-vite-preload async blocking=render type=module\${this.___viteInjectAttrs}>\`;
655
- html+= "await Promise.allSettled([";
644
+ html += "await Promise.allSettled([";
656
645
 
657
646
  for (const id of preload) {
658
- html += \`import(\${JSON.stringify(base + id)}),\`;
647
+ html += sep + \`import(\${JSON.stringify(base + id)})\`;
648
+ sep = ",";
659
649
  }
660
650
 
661
651
  html += "]);";
662
- html += "document.documentElement.style.visibility='';";
663
- html += "if(document.documentElement.getAttribute('style')==='')document.documentElement.removeAttribute('style');";
664
- html += "document.querySelectorAll('[marko-vite-preload]').forEach((el) => el.remove());";
665
- html += \`</script><script marko-vite-preload\${this.___viteInjectAttrs}>document.documentElement.style.visibility='hidden'</script>\`;
652
+ html += "document.querySelectorAll('[marko-vite-preload]').forEach(el=>el.remove());";
653
+ html += \`</script>\`;
666
654
  }
667
655
  }`}
668
656
 
@@ -885,6 +873,7 @@ function markoPlugin(opts = {}) {
885
873
  runtimeId,
886
874
  sourceMaps: true,
887
875
  writeVersionComment: false,
876
+ resolveVirtualDependency,
888
877
  optimizeKnownTemplates: optimize && linked ? getKnownTemplates(root) : void 0,
889
878
  babelConfig: opts.babelConfig ? {
890
879
  ...opts.babelConfig,
@@ -916,7 +905,6 @@ function markoPlugin(opts = {}) {
916
905
  });
917
906
  ssrConfig = {
918
907
  ...baseConfig,
919
- resolveVirtualDependency,
920
908
  output: "html"
921
909
  };
922
910
  ssrCjsConfig = {
@@ -925,7 +913,6 @@ function markoPlugin(opts = {}) {
925
913
  };
926
914
  domConfig = {
927
915
  ...baseConfig,
928
- resolveVirtualDependency,
929
916
  output: "dom"
930
917
  };
931
918
  if (isTest) {
@@ -933,7 +920,6 @@ function markoPlugin(opts = {}) {
933
920
  }
934
921
  hydrateConfig = {
935
922
  ...baseConfig,
936
- resolveVirtualDependency,
937
923
  output: "hydrate"
938
924
  };
939
925
  compiler2.configure(baseConfig);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marko/vite",
3
- "version": "5.1.4",
3
+ "version": "5.1.6",
4
4
  "description": "A Marko plugin for Vite",
5
5
  "keywords": [
6
6
  "loader",
@@ -45,47 +45,47 @@
45
45
  "anymatch": "^3.1.3",
46
46
  "domelementtype": "^2.3.0",
47
47
  "domhandler": "^5.0.3",
48
- "fast-glob": "^3.3.2",
49
- "htmlparser2": "^9.1.0",
50
- "resolve": "^1.22.8",
51
- "resolve.exports": "^2.0.2"
48
+ "fast-glob": "^3.3.3",
49
+ "htmlparser2": "^10.0.0",
50
+ "resolve": "^1.22.10",
51
+ "resolve.exports": "^2.0.3"
52
52
  },
53
53
  "devDependencies": {
54
- "@changesets/changelog-github": "^0.5.0",
55
- "@changesets/cli": "^2.27.10",
56
- "@eslint/js": "^9.15.0",
57
- "@marko/compiler": "^5.38.1",
54
+ "@changesets/changelog-github": "^0.5.1",
55
+ "@changesets/cli": "^2.29.5",
56
+ "@eslint/js": "^9.29.0",
57
+ "@marko/compiler": "^5.39.28",
58
58
  "@marko/fixture-snapshots": "^2.2.1",
59
59
  "@marko/testing-library": "^6.2.0",
60
60
  "@types/babel__core": "^7.20.5",
61
- "@types/diff": "^6.0.0",
61
+ "@types/diff": "^8.0.0",
62
62
  "@types/jsdom": "^21.1.7",
63
63
  "@types/mocha": "^10.0.10",
64
- "@types/node": "^22.10.0",
64
+ "@types/node": "^24.0.4",
65
65
  "@types/resolve": "^1.20.6",
66
66
  "@types/serve-handler": "^6.1.4",
67
67
  "cross-env": "^7.0.3",
68
- "diff": "^7.0.0",
69
- "esbuild": "^0.24.0",
70
- "eslint": "^9.15.0",
68
+ "diff": "^8.0.2",
69
+ "esbuild": "^0.25.5",
70
+ "eslint": "^9.29.0",
71
71
  "eslint-formatter-unix": "^8.40.0",
72
72
  "eslint-plugin-simple-import-sort": "^12.1.1",
73
- "globals": "^15.12.0",
73
+ "globals": "^16.2.0",
74
74
  "husky": "^9.1.7",
75
- "jsdom": "^25.0.1",
76
- "less": "^4.2.1",
77
- "lint-staged": "^15.2.10",
78
- "marko": "^5.36.1",
79
- "mocha": "^10.8.2",
75
+ "jsdom": "^26.1.0",
76
+ "less": "^4.3.0",
77
+ "lint-staged": "^16.1.2",
78
+ "marko": "^5.37.40",
79
+ "mocha": "^11.7.1",
80
80
  "mocha-snap": "^5.0.0",
81
81
  "nyc": "^17.1.0",
82
- "playwright": "^1.49.0",
83
- "prettier": "^3.4.1",
84
- "prettier-plugin-packagejson": "^2.5.6",
82
+ "playwright": "^1.53.1",
83
+ "prettier": "^3.6.1",
84
+ "prettier-plugin-packagejson": "^2.5.15",
85
85
  "serve-handler": "^6.1.6",
86
- "tsx": "^4.19.2",
87
- "typescript": "^5.7.2",
88
- "typescript-eslint": "^8.16.0",
86
+ "tsx": "^4.20.3",
87
+ "typescript": "^5.8.3",
88
+ "typescript-eslint": "^8.35.0",
89
89
  "vite": "^6.0.0"
90
90
  },
91
91
  "peerDependencies": {