@vizejs/vite-plugin 0.177.0 → 0.179.0

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.d.mts CHANGED
@@ -65,9 +65,9 @@ interface CompilerConfig {
65
65
  */
66
66
  ssr?: boolean;
67
67
  /**
68
- * Enable Vue parser quirk compatibility
68
+ * Template syntax compatibility mode
69
69
  */
70
- vueParserQuirks?: boolean;
70
+ templateSyntax?: "standard" | "strict" | "quirks";
71
71
  /**
72
72
  * Enable source map generation
73
73
  */
@@ -733,10 +733,10 @@ interface VizeOptions {
733
733
  */
734
734
  customRenderer?: boolean;
735
735
  /**
736
- * Enable compatibility for known Vue compiler parser quirks.
737
- * @default false
736
+ * Template syntax compatibility mode.
737
+ * @default "standard"
738
738
  */
739
- vueParserQuirks?: boolean;
739
+ templateSyntax?: "standard" | "strict" | "quirks";
740
740
  /**
741
741
  * Root directory to scan for .vue files
742
742
  * @default Vite's root
package/dist/index.mjs CHANGED
@@ -282,28 +282,28 @@ const vizeConfigStore = /* @__PURE__ */ new Map();
282
282
  function buildCompileFileOptions(filePath, options) {
283
283
  return {
284
284
  filename: filePath,
285
- mode: options.mode,
286
285
  sourceMap: options.sourceMap,
287
286
  ssr: options.ssr,
288
287
  vapor: options.vapor,
289
288
  customRenderer: options.customRenderer ?? false,
290
- vueParserQuirks: options.vueParserQuirks ?? false,
291
- runtimeModuleName: options.runtimeModuleName,
292
- runtimeGlobalName: options.runtimeGlobalName,
293
- vueVersion: options.vueVersion == null ? void 0 : String(options.vueVersion),
294
- scopeId: `data-v-${generateScopeId(filePath)}`
289
+ scopeId: `data-v-${generateScopeId(filePath)}`,
290
+ ...options.mode === void 0 ? {} : { mode: options.mode },
291
+ ...options.templateSyntax === void 0 ? {} : { templateSyntax: options.templateSyntax },
292
+ ...options.runtimeModuleName === void 0 ? {} : { runtimeModuleName: options.runtimeModuleName },
293
+ ...options.runtimeGlobalName === void 0 ? {} : { runtimeGlobalName: options.runtimeGlobalName },
294
+ ...options.vueVersion == null ? {} : { vueVersion: String(options.vueVersion) }
295
295
  };
296
296
  }
297
297
  function buildCompileBatchOptions(options) {
298
298
  return {
299
- mode: options.mode,
300
299
  ssr: options.ssr,
301
300
  vapor: options.vapor,
302
301
  customRenderer: options.customRenderer ?? false,
303
- vueParserQuirks: options.vueParserQuirks ?? false,
304
- runtimeModuleName: options.runtimeModuleName,
305
- runtimeGlobalName: options.runtimeGlobalName,
306
- vueVersion: options.vueVersion == null ? void 0 : String(options.vueVersion)
302
+ ...options.mode === void 0 ? {} : { mode: options.mode },
303
+ ...options.templateSyntax === void 0 ? {} : { templateSyntax: options.templateSyntax },
304
+ ...options.runtimeModuleName === void 0 ? {} : { runtimeModuleName: options.runtimeModuleName },
305
+ ...options.runtimeGlobalName === void 0 ? {} : { runtimeGlobalName: options.runtimeGlobalName },
306
+ ...options.vueVersion == null ? {} : { vueVersion: String(options.vueVersion) }
307
307
  };
308
308
  }
309
309
  //#endregion
@@ -422,7 +422,7 @@ function getCompileOptionsForRequest(state, ssr) {
422
422
  ssr,
423
423
  vapor: !ssr && (state.mergedOptions?.vapor ?? false),
424
424
  customRenderer: state.mergedOptions?.customRenderer ?? false,
425
- vueParserQuirks: state.mergedOptions?.vueParserQuirks ?? false
425
+ templateSyntax: state.mergedOptions?.templateSyntax ?? "standard"
426
426
  };
427
427
  if (state.mergedOptions?.mode !== void 0) options.mode = state.mergedOptions.mode;
428
428
  if (state.mergedOptions?.runtimeModuleName !== void 0) options.runtimeModuleName = state.mergedOptions.runtimeModuleName;
@@ -515,7 +515,7 @@ async function compileAll(state) {
515
515
  vapor: state.mergedOptions.vapor ?? false,
516
516
  mode: state.mergedOptions.mode,
517
517
  customRenderer: state.mergedOptions.customRenderer ?? false,
518
- vueParserQuirks: state.mergedOptions.vueParserQuirks ?? false,
518
+ templateSyntax: state.mergedOptions.templateSyntax ?? "standard",
519
519
  runtimeModuleName: state.mergedOptions.runtimeModuleName,
520
520
  runtimeGlobalName: state.mergedOptions.runtimeGlobalName,
521
521
  vueVersion: state.mergedOptions.vueVersion
@@ -877,10 +877,13 @@ function nativeCssAliasRules(state) {
877
877
  function isPotentialVizeResolveId(id) {
878
878
  return id.startsWith("\0") || id.startsWith("vize:") || id.startsWith("/@fs") || isProjectVueRuntimeRequest(id) || id === "virtual:vize-styles" || id.endsWith(".vue") || id.includes(".vue?") || id.includes(".vue.ts?") || id.includes("?macro=true") || id.includes("?definePage");
879
879
  }
880
- function isPotentialVizeImporter(importer) {
880
+ function classifyImporterRequest(importer) {
881
+ return importer ? classifyVitePluginRequest(importer) : null;
882
+ }
883
+ function isPotentialVizeImporter(importer, importerRequest) {
881
884
  if (importer === void 0) return false;
882
885
  if (importer.startsWith("\0") || importer.startsWith("vize:")) return true;
883
- return classifyVitePluginRequest(importer).isVueSfcPath;
886
+ return importerRequest?.isVueSfcPath ?? false;
884
887
  }
885
888
  function shouldCompileVueSfcRequest(request) {
886
889
  if (!request.isVueSfcPath || request.isVueStyleQuery || request.hasMacroQuery || request.hasDefinePageQuery) return false;
@@ -921,10 +924,10 @@ async function resolveAliasedVueImport(ctx, state, id, importer, isSsrRequest, h
921
924
  return null;
922
925
  }
923
926
  async function resolveIdHook(ctx, state, id, importer, options) {
924
- if (!isPotentialVizeResolveId(id) && !isPotentialVizeImporter(importer)) return null;
927
+ const importerRequest = classifyImporterRequest(importer);
928
+ if (!isPotentialVizeResolveId(id) && !isPotentialVizeImporter(importer, importerRequest)) return null;
925
929
  const isBuild = state.server === null;
926
930
  const isDependencyScan = !!options?.scan;
927
- const importerRequest = importer ? classifyVitePluginRequest(importer) : null;
928
931
  const isSsrRequest = !!options?.ssr || (importerRequest?.isVizeSsrVirtual ?? false) || (importer ? isPluginVisibleSsrVirtualId(importer) : false);
929
932
  const request = classifyVitePluginRequest(id);
930
933
  const pluginVisibleVirtualPath = fromPluginVisibleVirtualId(id);
@@ -1893,13 +1896,14 @@ function vize(options = {}) {
1893
1896
  const compatibility = resolveCompatibilityOptions(options, compilerConfig);
1894
1897
  const vueVersion = options.vueVersion ?? compatibility.vueVersion ?? 3;
1895
1898
  const mode = options.mode ?? compilerConfig.mode ?? (compatibility.scriptSetupInStandalone === true ? "function" : "module");
1899
+ const templateSyntax = options.templateSyntax ?? compilerConfig.templateSyntax ?? "standard";
1896
1900
  state.mergedOptions = {
1897
1901
  ...options,
1898
1902
  ssr: options.ssr ?? compilerConfig.ssr ?? false,
1899
1903
  sourceMap: options.sourceMap ?? compilerConfig.sourceMap,
1900
1904
  vapor: options.vapor ?? compilerConfig.vapor ?? false,
1901
1905
  customRenderer: options.customRenderer ?? compilerConfig.customRenderer ?? false,
1902
- vueParserQuirks: options.vueParserQuirks ?? compilerConfig.vueParserQuirks ?? false,
1906
+ templateSyntax,
1903
1907
  compatibility,
1904
1908
  vueVersion,
1905
1909
  mode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/vite-plugin",
3
- "version": "0.177.0",
3
+ "version": "0.179.0",
4
4
  "description": "High-performance native Vite plugin for Vue SFC compilation powered by Vize",
5
5
  "keywords": [
6
6
  "compiler",
@@ -39,9 +39,9 @@
39
39
  "access": "public"
40
40
  },
41
41
  "dependencies": {
42
- "@vizejs/native": "0.177.0",
42
+ "@vizejs/native": "0.179.0",
43
43
  "tinyglobby": "0.2.16",
44
- "vize": "0.177.0"
44
+ "vize": "0.179.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/node": "25.7.0",