@vizejs/vite-plugin 0.578.0 → 0.579.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/{config-CBpX4B3I.mjs → config-B8VPzseE.mjs} +9 -1
- package/dist/index.mjs +2 -2
- package/dist/internal/vite-plus-task.mjs +1 -1
- package/dist/{plugin-DLppaaxw.mjs → plugin-BSGwbSJz.mjs} +3 -3
- package/dist/plugin-CeCw6Vr2.mjs +2 -0
- package/dist/{runner-DnEWSuYK.mjs → runner-B9IXn5R2.mjs} +1 -1
- package/dist/vite-plus.mjs +23 -7
- package/package.json +4 -4
- package/dist/plugin-BLDiTt3h.mjs +0 -2
|
@@ -107,7 +107,9 @@ async function projectViteConfigSource(source, env, configDir) {
|
|
|
107
107
|
}
|
|
108
108
|
if (object(source.fmt)) {
|
|
109
109
|
const keys = vueOptionSchema.definitions.FormatterConfig.properties;
|
|
110
|
-
|
|
110
|
+
const common = Object.fromEntries(Object.entries(source.fmt).filter(([key]) => Object.hasOwn(keys, key)));
|
|
111
|
+
if (Array.isArray(common.ignorePatterns)) common.ignorePatterns = common.ignorePatterns.filter((pattern) => !excludesEveryVueFile(pattern));
|
|
112
|
+
overrides.formatter = overlayVueOptions(common, object(source.fmt.vue) ? source.fmt.vue : {});
|
|
111
113
|
validateVueOption(overrides.formatter, { $ref: "#/definitions/FormatterConfig" }, "fmt");
|
|
112
114
|
}
|
|
113
115
|
const root = typeof source.root === "string" ? resolve(configDir ?? ".", source.root) : configDir;
|
|
@@ -117,6 +119,12 @@ async function projectViteConfigSource(source, env, configDir) {
|
|
|
117
119
|
__vizeProjectRoot: root
|
|
118
120
|
} : config;
|
|
119
121
|
}
|
|
122
|
+
function excludesEveryVueFile(pattern) {
|
|
123
|
+
if (typeof pattern !== "string") return false;
|
|
124
|
+
let rest = pattern;
|
|
125
|
+
while (rest.startsWith("**/")) rest = rest.slice(3);
|
|
126
|
+
return rest === "*.vue";
|
|
127
|
+
}
|
|
120
128
|
/** Validate only canonical settings; selecting them never evaluates a legacy callback. */
|
|
121
129
|
function vueConfigOptions(source) {
|
|
122
130
|
const selected = source.vue;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as vize } from "./plugin-
|
|
1
|
+
import { t as vize } from "./plugin-BSGwbSJz.mjs";
|
|
2
2
|
import { u as rewriteStaticAssetUrls } from "./vue-version-BFh0eI6J.mjs";
|
|
3
|
-
import { a as resolveViteConfigExport, i as resolveConfigExport, n as defineConfig, o as vizeConfigStore, r as loadConfig, t as VIZE_CONFIG_FILE_ENV } from "./config-
|
|
3
|
+
import { a as resolveViteConfigExport, i as resolveConfigExport, n as defineConfig, o as vizeConfigStore, r as loadConfig, t as VIZE_CONFIG_FILE_ENV } from "./config-B8VPzseE.mjs";
|
|
4
4
|
//#region src/index.ts
|
|
5
5
|
const __internal = { rewriteStaticAssetUrls };
|
|
6
6
|
var src_default = vize;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as removeHostVueSfcCompilers, c as rewriteDynamicTemplateImports, d as shouldApplyDefineInVirtualModule, i as isLegacyVueVersion, l as rewriteImportMetaGlobBase, o as applyDefineReplacements, r as isLegacyVueCompatibilityMode, s as createLogger, t as createLegacyVueCompatibilityPlugin, u as rewriteStaticAssetUrls } from "./vue-version-BFh0eI6J.mjs";
|
|
2
|
-
import { a as resolveViteConfigExport, i as resolveConfigExport, o as vizeConfigStore, r as loadConfig } from "./config-
|
|
2
|
+
import { a as resolveViteConfigExport, i as resolveConfigExport, o as vizeConfigStore, r as loadConfig } from "./config-B8VPzseE.mjs";
|
|
3
3
|
import { n as registerResolvedVizeConfig, r as unregisterResolvedVizeConfig } from "./config-bridge-Dv6U7_RC.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import * as native from "@vizejs/native";
|
|
@@ -4185,10 +4185,10 @@ function mergeCompilerOptions(options, sharedConfig, defaults = {}) {
|
|
|
4185
4185
|
...options.template,
|
|
4186
4186
|
compilerOptions: {
|
|
4187
4187
|
cacheHandlers: compilerConfig.cacheHandlers,
|
|
4188
|
-
comments: compilerConfig.comments ?? defaults.comments,
|
|
4189
4188
|
hoistStatic: compilerConfig.hoistStatic,
|
|
4190
4189
|
prefixIdentifiers: compilerConfig.prefixIdentifiers,
|
|
4191
|
-
...options.template?.compilerOptions
|
|
4190
|
+
...options.template?.compilerOptions,
|
|
4191
|
+
comments: options.template?.compilerOptions?.comments ?? compilerConfig.comments ?? defaults.comments
|
|
4192
4192
|
}
|
|
4193
4193
|
},
|
|
4194
4194
|
compatibility,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as resolveConfigExport, r as loadConfig } from "./config-
|
|
1
|
+
import { i as resolveConfigExport, r as loadConfig } from "./config-B8VPzseE.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { mkdirSync, mkdtempSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
|
package/dist/vite-plus.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as projectViteConfigSource, i as resolveConfigExport, l as vueConfigOptions, s as mergeVueConfigOptions } from "./config-
|
|
2
|
-
import { a as taskConfigKey, i as sourceConfigKey, r as availableVueRules, t as runNative } from "./runner-
|
|
1
|
+
import { c as projectViteConfigSource, i as resolveConfigExport, l as vueConfigOptions, s as mergeVueConfigOptions } from "./config-B8VPzseE.mjs";
|
|
2
|
+
import { a as taskConfigKey, i as sourceConfigKey, r as availableVueRules, t as runNative } from "./runner-B9IXn5R2.mjs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { readFileSync } from "node:fs";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
@@ -155,7 +155,8 @@ function normalizeConfig(source, integration) {
|
|
|
155
155
|
const resolvedHostLint = composeHostLint(lint ? oxlint : void 0, hostLint);
|
|
156
156
|
const hostVizeSettings = recordValue(resolvedHostLint?.settings?.vize);
|
|
157
157
|
const lintConfig = nativeLint;
|
|
158
|
-
const
|
|
158
|
+
const pluginOptions = compilerOption ?? integration.plugin ?? {};
|
|
159
|
+
const compiler = vueCompiler(pluginOptions, vue);
|
|
159
160
|
const options = {
|
|
160
161
|
...integration,
|
|
161
162
|
check: (vue?.typeCheck ?? vue?.typeChecker)?.enabled !== void 0 ? (vue?.typeCheck ?? vue?.typeChecker)?.enabled : typecheck === false ? false : typeof typecheck === "object" ? typecheck.enabled !== false : typecheck ?? integration.check,
|
|
@@ -179,7 +180,8 @@ function normalizeConfig(source, integration) {
|
|
|
179
180
|
fmt: fmt ? oxfmt : void 0
|
|
180
181
|
},
|
|
181
182
|
metadata,
|
|
182
|
-
compiler
|
|
183
|
+
compiler,
|
|
184
|
+
plugin: vitePluginOptions(pluginOptions, compiler)
|
|
183
185
|
};
|
|
184
186
|
}
|
|
185
187
|
/** Compose the plain Vite+ lint policy with the Vue flat-config layer. */
|
|
@@ -218,6 +220,20 @@ function recordValue(value) {
|
|
|
218
220
|
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
|
|
219
221
|
}
|
|
220
222
|
/** Keep plugin-only fields while native canonical leaves choose their own values. */
|
|
223
|
+
/**
|
|
224
|
+
* The Vite plugin reads `vue.compiler` from `metadata.config`, where
|
|
225
|
+
* `vue.entries[].compiler` scopes apply per file. Repeating those settings as
|
|
226
|
+
* explicit plugin options would override every scope (#10781). Only the dialect
|
|
227
|
+
* stays explicit: legacy compiler selection reads it before the config loads.
|
|
228
|
+
*/
|
|
229
|
+
function vitePluginOptions(options, compiler) {
|
|
230
|
+
if (options === false || compiler === false || compiler === options) return compiler;
|
|
231
|
+
return {
|
|
232
|
+
...options,
|
|
233
|
+
compatibility: compiler.compatibility,
|
|
234
|
+
...compiler.vueVersion === void 0 ? {} : { vueVersion: compiler.vueVersion }
|
|
235
|
+
};
|
|
236
|
+
}
|
|
221
237
|
function vueCompiler(legacy, vue) {
|
|
222
238
|
if (legacy === false) return false;
|
|
223
239
|
const compiler = vue?.compile ?? vue?.compiler;
|
|
@@ -351,14 +367,14 @@ async function configurePack(input, compiler, metadata) {
|
|
|
351
367
|
function defineConfig(config = {}, integration = {}) {
|
|
352
368
|
return Object.assign(async (env) => {
|
|
353
369
|
const source = await resolveConfig(config, env);
|
|
354
|
-
const { vp, metadata, compiler } = normalizeConfig(source, integration);
|
|
370
|
+
const { vp, metadata, compiler, plugin } = normalizeConfig(source, integration);
|
|
355
371
|
const { options } = metadata;
|
|
356
372
|
const legacy = compiler !== false && (await import("./vue-version-DOjZaMiI.mjs")).isLegacyVueCompatibilityMode(compiler);
|
|
357
373
|
const plugins = compiler === false || legacy ? [...vp.plugins ?? []] : await withoutVueCompiler(vp.plugins ?? []);
|
|
358
374
|
if (compiler !== false) {
|
|
359
|
-
const { vize } = await import("./plugin-
|
|
375
|
+
const { vize } = await import("./plugin-CeCw6Vr2.mjs");
|
|
360
376
|
plugins.push(vize({
|
|
361
|
-
...
|
|
377
|
+
...plugin,
|
|
362
378
|
configMode: false,
|
|
363
379
|
config: metadata.config
|
|
364
380
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizejs/vite-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.579.0",
|
|
4
4
|
"description": "High-performance native Vite plugin for Vue SFC compilation powered by Vize",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compiler",
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@vizejs/native": "0.
|
|
55
|
-
"@vizejs/unplugin": "0.
|
|
54
|
+
"@vizejs/native": "0.579.0",
|
|
55
|
+
"@vizejs/unplugin": "0.579.0",
|
|
56
56
|
"jsonc-parser": "^3.3.1",
|
|
57
57
|
"oxc-parser": "0.144.0",
|
|
58
58
|
"picomatch": "4.0.5",
|
|
59
59
|
"tinyglobby": "0.2.17",
|
|
60
|
-
"vize": "0.
|
|
60
|
+
"vize": "0.579.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@types/node": "25.9.2",
|
package/dist/plugin-BLDiTt3h.mjs
DELETED