@vizejs/unplugin 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/babel.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { r as VizeUnpluginOptions } from "./types-oQVaBbVI.mjs";
1
+ import { r as VizeUnpluginOptions } from "./types-B13SJWBj.mjs";
2
2
 
3
3
  //#region src/babel.d.ts
4
4
  type BabelParserOptions = Record<string, unknown> & {
package/dist/babel.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as createFilter, i as generateOutput, r as compileVueModule, t as normalizeOptions } from "./unplugin-BhadWZfz.mjs";
1
+ import { a as createFilter, i as generateOutput, r as compileVueModule, t as normalizeOptions } from "./unplugin-B3sdC5nW.mjs";
2
2
  //#region src/babel.ts
3
3
  function vizeBabelPlugin(_api, rawOptions = {}) {
4
4
  const options = normalizeOptions(rawOptions);
@@ -1,4 +1,4 @@
1
- import { r as VizeUnpluginOptions } from "./types-oQVaBbVI.mjs";
1
+ import { r as VizeUnpluginOptions } from "./types-B13SJWBj.mjs";
2
2
  import * as _$unplugin from "unplugin";
3
3
 
4
4
  //#region src/esbuild.d.ts
package/dist/esbuild.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as vizeUnplugin } from "./unplugin-BhadWZfz.mjs";
1
+ import { n as vizeUnplugin } from "./unplugin-B3sdC5nW.mjs";
2
2
  //#region src/esbuild.ts
3
3
  var esbuild_default = vizeUnplugin.esbuild;
4
4
  //#endregion
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as VizeVueVersion, n as VizeCompatibilityOptions, r as VizeUnpluginOptions, t as MacroArtifact } from "./types-oQVaBbVI.mjs";
1
+ import { i as VizeVueVersion, n as VizeCompatibilityOptions, r as VizeUnpluginOptions, t as MacroArtifact } from "./types-B13SJWBj.mjs";
2
2
  import * as _$unplugin from "unplugin";
3
3
  //#region src/unplugin.d.ts
4
4
  declare const vizeUnplugin: _$unplugin.UnpluginInstance<VizeUnpluginOptions | undefined, boolean>;
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { n as vizeUnplugin } from "./unplugin-BhadWZfz.mjs";
1
+ import { n as vizeUnplugin } from "./unplugin-B3sdC5nW.mjs";
2
2
  export { vizeUnplugin as default, vizeUnplugin };
@@ -1,4 +1,4 @@
1
- import { r as VizeUnpluginOptions } from "./types-oQVaBbVI.mjs";
1
+ import { r as VizeUnpluginOptions } from "./types-B13SJWBj.mjs";
2
2
  import * as _$unplugin from "unplugin";
3
3
 
4
4
  //#region src/rolldown.d.ts
package/dist/rolldown.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as vizeUnplugin } from "./unplugin-BhadWZfz.mjs";
1
+ import { n as vizeUnplugin } from "./unplugin-B3sdC5nW.mjs";
2
2
  //#region src/rolldown.ts
3
3
  var rolldown_default = vizeUnplugin.rollup;
4
4
  //#endregion
package/dist/rollup.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { r as VizeUnpluginOptions } from "./types-oQVaBbVI.mjs";
1
+ import { r as VizeUnpluginOptions } from "./types-B13SJWBj.mjs";
2
2
  import * as _$unplugin from "unplugin";
3
3
 
4
4
  //#region src/rollup.d.ts
package/dist/rollup.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as vizeUnplugin } from "./unplugin-BhadWZfz.mjs";
1
+ import { n as vizeUnplugin } from "./unplugin-B3sdC5nW.mjs";
2
2
  //#region src/rollup.ts
3
3
  var rollup_default = vizeUnplugin.rollup;
4
4
  //#endregion
@@ -18,7 +18,7 @@ interface VizeUnpluginOptions {
18
18
  mode?: "module" | "function";
19
19
  vapor?: boolean;
20
20
  customRenderer?: boolean;
21
- vueParserQuirks?: boolean;
21
+ templateSyntax?: VizeTemplateSyntax;
22
22
  runtimeModuleName?: string;
23
23
  runtimeGlobalName?: string;
24
24
  vueVersion?: VizeVueVersion;
@@ -26,6 +26,7 @@ interface VizeUnpluginOptions {
26
26
  debug?: boolean;
27
27
  }
28
28
  type VizeVueVersion = 0.11 | 1 | 2 | 3 | "legacy";
29
+ type VizeTemplateSyntax = "standard" | "strict" | "quirks";
29
30
  interface VizeCompatibilityOptions {
30
31
  /**
31
32
  * Host Vue version. Vue 0.11/1/2 opt into host-compiler compatibility.
@@ -134,7 +134,7 @@ function buildSignature(options) {
134
134
  options.ssr ? "1" : "0",
135
135
  options.vapor ? "1" : "0",
136
136
  options.customRenderer ? "1" : "0",
137
- options.vueParserQuirks ? "1" : "0",
137
+ options.templateSyntax,
138
138
  options.sourceMap ? "1" : "0",
139
139
  options.mode,
140
140
  options.runtimeModuleName,
@@ -163,7 +163,7 @@ function compileVueModule(filePath, source, options, cache) {
163
163
  ssr: options.ssr,
164
164
  vapor: options.vapor,
165
165
  customRenderer: options.customRenderer,
166
- vueParserQuirks: options.vueParserQuirks,
166
+ templateSyntax: options.templateSyntax,
167
167
  runtimeModuleName: options.runtimeModuleName,
168
168
  runtimeGlobalName: options.runtimeGlobalName,
169
169
  vueVersion: String(options.vueVersion),
@@ -198,6 +198,7 @@ function isVueFile(id) {
198
198
  return id.endsWith(".vue");
199
199
  }
200
200
  function isVueStyleRequest(id) {
201
+ if (!id.includes("?vue")) return false;
201
202
  const { query } = parseVueRequest(id);
202
203
  return query.vue && query.type === "style";
203
204
  }
@@ -269,12 +270,16 @@ function normalizeVueVersion(version) {
269
270
  function isLegacyVueVersion(version) {
270
271
  return version === "legacy" || version === .11 || version === 1 || version === 2;
271
272
  }
273
+ function normalizeTemplateSyntax(templateSyntax) {
274
+ return templateSyntax ?? "standard";
275
+ }
272
276
  function normalizeOptions(rawOptions = {}) {
273
277
  const isProduction = rawOptions.isProduction ?? process.env.NODE_ENV === "production";
274
278
  const compatibility = rawOptions.compatibility ?? {};
275
279
  const vueVersion = normalizeVueVersion(rawOptions.vueVersion ?? compatibility.vueVersion);
276
280
  const mode = rawOptions.mode ?? (compatibility.scriptSetupInStandalone === true ? "function" : "module");
277
281
  const hostCompiler = compatibility.hostCompiler ?? isLegacyVueVersion(vueVersion);
282
+ const templateSyntax = normalizeTemplateSyntax(rawOptions.templateSyntax);
278
283
  return {
279
284
  include: rawOptions.include,
280
285
  exclude: rawOptions.exclude,
@@ -285,7 +290,7 @@ function normalizeOptions(rawOptions = {}) {
285
290
  mode,
286
291
  vapor: rawOptions.vapor ?? false,
287
292
  customRenderer: rawOptions.customRenderer ?? false,
288
- vueParserQuirks: rawOptions.vueParserQuirks ?? false,
293
+ templateSyntax,
289
294
  runtimeModuleName: rawOptions.runtimeModuleName ?? "vue",
290
295
  runtimeGlobalName: rawOptions.runtimeGlobalName ?? "Vue",
291
296
  vueVersion,
@@ -361,6 +366,7 @@ const vizeUnplugin = createUnplugin((rawOptions = {}) => {
361
366
  },
362
367
  transformInclude(id) {
363
368
  if (options.hostCompiler) return false;
369
+ if (!id.includes(".vue")) return false;
364
370
  const request = parseVueRequest(id);
365
371
  return !request.query.vue && isVueFile(request.filename) && filter(request.filename);
366
372
  },
@@ -1,4 +1,4 @@
1
- import { r as VizeUnpluginOptions } from "./types-oQVaBbVI.mjs";
1
+ import { r as VizeUnpluginOptions } from "./types-B13SJWBj.mjs";
2
2
  import * as _$webpack from "webpack";
3
3
 
4
4
  //#region src/webpack.d.ts
package/dist/webpack.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as vizeUnplugin } from "./unplugin-BhadWZfz.mjs";
1
+ import { n as vizeUnplugin } from "./unplugin-B3sdC5nW.mjs";
2
2
  //#region src/webpack.ts
3
3
  var webpack_default = vizeUnplugin.webpack;
4
4
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/unplugin",
3
- "version": "0.177.0",
3
+ "version": "0.179.0",
4
4
  "description": "Experimental Vue SFC integrations for Rollup, Rolldown, Webpack, esbuild, and Babel powered by Vize",
5
5
  "keywords": [
6
6
  "babel",
@@ -67,7 +67,7 @@
67
67
  "access": "public"
68
68
  },
69
69
  "dependencies": {
70
- "@vizejs/native": "0.177.0",
70
+ "@vizejs/native": "0.179.0",
71
71
  "oxc-transform": "0.130.0",
72
72
  "unplugin": "3.0.0"
73
73
  },