@vizejs/vite-plugin 0.432.0 → 0.434.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/README.md +5 -0
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +1 -1
- package/dist/internal/config-bridge.d.mts +1 -1
- package/dist/internal/vite-plus-task.mjs +1 -1
- package/dist/{plugin-DZV6zTPW.mjs → plugin-BFLLSOo5.mjs} +23 -12
- package/dist/plugin-C8JA-lhE.mjs +2 -0
- package/dist/{runner-D0tDOiOp.mjs → runner-BewZHurL.mjs} +4 -0
- package/dist/{types-NyrQJOwS.d.mts → types-CW8YdI0Y.d.mts} +5 -0
- package/dist/vite-plus.d.mts +1 -1
- package/dist/vite-plus.mjs +2 -2
- package/package.json +4 -4
- package/dist/plugin-9jvcWEU8.mjs +0 -2
package/README.md
CHANGED
|
@@ -328,3 +328,8 @@ Use `vite-plugin-vize` when you need:
|
|
|
328
328
|
## License
|
|
329
329
|
|
|
330
330
|
MIT
|
|
331
|
+
|
|
332
|
+
Framework integrations can pass an inherited whitespace default as the second
|
|
333
|
+
argument to `vize(options, { whitespace: "preserve" })`. Project compiler settings
|
|
334
|
+
and matching `entries[].compiler` override that default; explicit plugin and
|
|
335
|
+
nested template compiler options retain their existing precedence.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as VizeInspectorLintPlanProvider, c as VizeCompatibilityOptions, d as LoadConfigOptions, f as ResolvedVizeConfig, i as VizeVueFeatures, l as VizeVueVersion, m as UserConfigExport, n as CompiledModule, o as VizeInspectorLintPlanRequest, r as MacroArtifact, s as VizeInspectorOptions, t as VizeOptions, u as ConfigEnv, y as VizeConfig } from "./types-
|
|
1
|
+
import { a as VizeInspectorLintPlanProvider, c as VizeCompatibilityOptions, d as LoadConfigOptions, f as ResolvedVizeConfig, i as VizeVueFeatures, l as VizeVueVersion, m as UserConfigExport, n as CompiledModule, o as VizeInspectorLintPlanRequest, r as MacroArtifact, s as VizeInspectorOptions, t as VizeOptions, u as ConfigEnv, y as VizeConfig } from "./types-CW8YdI0Y.mjs";
|
|
2
2
|
import { Plugin } from "vite";
|
|
3
3
|
|
|
4
4
|
//#region src/virtual.d.ts
|
|
@@ -18,7 +18,8 @@ interface DynamicImportAliasRule {
|
|
|
18
18
|
declare function rewriteStaticAssetUrls(code: string, aliasRules: DynamicImportAliasRule[]): string;
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/plugin/index.d.ts
|
|
21
|
-
|
|
21
|
+
/** Framework-derived defaults yield to project, entry, and explicit plugin options. */
|
|
22
|
+
declare function vize(options?: VizeOptions, compilerDefaults?: Pick<VizeOptions, "whitespace">): Plugin[];
|
|
22
23
|
//#endregion
|
|
23
24
|
//#region src/config.d.ts
|
|
24
25
|
declare function defineConfig(config: UserConfigExport): UserConfigExport;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as rewriteStaticAssetUrls, t as vize } from "./plugin-
|
|
1
|
+
import { n as rewriteStaticAssetUrls, t as vize } from "./plugin-BFLLSOo5.mjs";
|
|
2
2
|
import { a as vizeConfigStore, i as resolveConfigExport, n as defineConfig, r as loadConfig, t as VIZE_CONFIG_FILE_ENV } from "./config-PP6EAmWc.mjs";
|
|
3
3
|
//#region src/index.ts
|
|
4
4
|
const __internal = { rewriteStaticAssetUrls };
|
|
@@ -902,6 +902,7 @@ function getCompileOptionsForRequest(state, ssr, file) {
|
|
|
902
902
|
templateComments: !state.isProduction,
|
|
903
903
|
...resolvePluginVueCompileOptions(mergedOptions ?? {})
|
|
904
904
|
};
|
|
905
|
+
if (mergedOptions?.nuxtPageMeta !== void 0) options.nuxtPageMeta = mergedOptions.nuxtPageMeta;
|
|
905
906
|
if (mergedOptions?.customElements !== void 0) options.customElements = mergedOptions.customElements;
|
|
906
907
|
if (mergedOptions?.mode !== void 0) options.mode = mergedOptions.mode;
|
|
907
908
|
if (mergedOptions?.runtimeModuleName !== void 0) options.runtimeModuleName = mergedOptions.runtimeModuleName;
|
|
@@ -1044,6 +1045,7 @@ function buildCompileFileOptions(filePath, options) {
|
|
|
1044
1045
|
sourceMap: options.sourceMap,
|
|
1045
1046
|
ssr: options.ssr,
|
|
1046
1047
|
vapor: options.vapor,
|
|
1048
|
+
...options.nuxtPageMeta === void 0 ? {} : { nuxtPageMeta: options.nuxtPageMeta },
|
|
1047
1049
|
...options.whitespace === void 0 ? {} : { whitespace: options.whitespace },
|
|
1048
1050
|
customRenderer: options.customRenderer ?? false,
|
|
1049
1051
|
...options.customElements === void 0 ? {} : { customElements: options.customElements },
|
|
@@ -1071,6 +1073,7 @@ function buildCompileBatchOptions(options) {
|
|
|
1071
1073
|
return {
|
|
1072
1074
|
ssr: options.ssr,
|
|
1073
1075
|
vapor: options.vapor,
|
|
1076
|
+
...options.nuxtPageMeta === void 0 ? {} : { nuxtPageMeta: options.nuxtPageMeta },
|
|
1074
1077
|
...options.whitespace === void 0 ? {} : { whitespace: options.whitespace },
|
|
1075
1078
|
customRenderer: options.customRenderer ?? false,
|
|
1076
1079
|
...options.customElements === void 0 ? {} : { customElements: options.customElements },
|
|
@@ -2068,6 +2071,10 @@ async function resolveRelativeVueSfcImport(ctx, state, id, cleanImporter, isSsrR
|
|
|
2068
2071
|
const resolvedPath = resolvedRequest.normalizedFsId ?? resolvedRequest.normalizedVuePath;
|
|
2069
2072
|
if (!resolvedPath || !resolvedPath.endsWith(".vue")) return resolved;
|
|
2070
2073
|
const effectiveQuery = resolvedRequest.querySuffix || querySuffix;
|
|
2074
|
+
if (effectiveQuery) {
|
|
2075
|
+
const params = new URLSearchParams(effectiveQuery.slice(1));
|
|
2076
|
+
if (params.has("raw") || params.has("url") || params.has("worker") || params.has("sharedworker")) return resolved;
|
|
2077
|
+
}
|
|
2071
2078
|
return isDependencyScan ? resolvedPath : toPluginVisibleVirtualId(resolvedPath, isSsrRequest, effectiveQuery);
|
|
2072
2079
|
}
|
|
2073
2080
|
//#endregion
|
|
@@ -3000,7 +3007,7 @@ function findMacroArtifactModule(state, realPath, ssr, kind) {
|
|
|
3000
3007
|
}, realPath, compiled);
|
|
3001
3008
|
return compiled?.macroArtifacts?.find((artifact) => artifact.kind === kind)?.moduleCode ?? null;
|
|
3002
3009
|
}
|
|
3003
|
-
function loadCompiledSfcModule(state, realPath, isSsr, currentBase, loadOptions) {
|
|
3010
|
+
function loadCompiledSfcModule(state, realPath, isSsr, currentBase, needsGlobBaseRewrite, loadOptions) {
|
|
3004
3011
|
const placeholderCode = getBoundaryPlaceholderCode(realPath, !!loadOptions?.ssr);
|
|
3005
3012
|
if (placeholderCode) {
|
|
3006
3013
|
state.logger.log(`load: using boundary placeholder for ${realPath}`);
|
|
@@ -3041,7 +3048,7 @@ function loadCompiledSfcModule(state, realPath, isSsr, currentBase, loadOptions)
|
|
|
3041
3048
|
const rewritten = new MappedModule(isSsr ? normalizeVueServerRendererImport(emitted.code) : emitted.code, emitted.map);
|
|
3042
3049
|
rewritten.edit(rewriteDynamicTemplateImports(rewritten.code, state.dynamicImportAliasRules));
|
|
3043
3050
|
rewritten.edit(rewriteStaticAssetUrls(rewritten.code, state.dynamicImportAliasRules));
|
|
3044
|
-
rewritten.edit(rewriteImportMetaGlobBase(rewritten.code, realPath, state.root));
|
|
3051
|
+
if (needsGlobBaseRewrite) rewritten.edit(rewriteImportMetaGlobBase(rewritten.code, realPath, state.root));
|
|
3045
3052
|
rewritten.edit(registerSfcModule(state, rewritten.code, realPath, isSsr));
|
|
3046
3053
|
return loadedSfcModule(rewritten.code, rewritten.map, state.isProduction, isSsr, compiled);
|
|
3047
3054
|
}
|
|
@@ -3114,11 +3121,11 @@ function loadHook(state, id, loadOptions) {
|
|
|
3114
3121
|
return null;
|
|
3115
3122
|
}
|
|
3116
3123
|
if (!shouldLoadCompiledVueSfcPath(state, realPath)) return null;
|
|
3117
|
-
return loadCompiledSfcModule(state, realPath, isSsr, currentBase, loadOptions);
|
|
3124
|
+
return loadCompiledSfcModule(state, realPath, isSsr, currentBase, id.startsWith("\0"), loadOptions);
|
|
3118
3125
|
}
|
|
3119
3126
|
if (loadableVueSfcPath) {
|
|
3120
3127
|
if (!shouldLoadCompiledVueSfcPath(state, loadableVueSfcPath, !!request.querySuffix && new URLSearchParams(request.querySuffix.slice(1)).has("nuxt_component"))) return null;
|
|
3121
|
-
return loadCompiledSfcModule(state, loadableVueSfcPath, !!loadOptions?.ssr, currentBase, loadOptions);
|
|
3128
|
+
return loadCompiledSfcModule(state, loadableVueSfcPath, !!loadOptions?.ssr, currentBase, false, loadOptions);
|
|
3122
3129
|
}
|
|
3123
3130
|
if (id.startsWith("\0")) {
|
|
3124
3131
|
const afterPrefix = id.startsWith("\0vize:") ? id.slice(6) : id.slice(1);
|
|
@@ -3970,7 +3977,7 @@ function resolveHookSsr(context, options) {
|
|
|
3970
3977
|
}
|
|
3971
3978
|
//#endregion
|
|
3972
3979
|
//#region src/plugin/compiler-config.ts
|
|
3973
|
-
function mergeCompilerOptions(options, sharedConfig) {
|
|
3980
|
+
function mergeCompilerOptions(options, sharedConfig, defaults = {}) {
|
|
3974
3981
|
const viteConfig = sharedConfig?.vite ?? {};
|
|
3975
3982
|
const compilerConfig = sharedConfig?.compiler ?? {};
|
|
3976
3983
|
const compatibility = resolveCompatibilityOptions(options, compilerConfig);
|
|
@@ -3985,7 +3992,7 @@ function mergeCompilerOptions(options, sharedConfig) {
|
|
|
3985
3992
|
customRenderer: options.customRenderer ?? compilerConfig.customRenderer ?? false,
|
|
3986
3993
|
customElements: options.customElements ?? compilerConfig.customElements,
|
|
3987
3994
|
templateSyntax,
|
|
3988
|
-
whitespace: options.whitespace ?? compilerConfig.whitespace,
|
|
3995
|
+
whitespace: options.whitespace ?? compilerConfig.whitespace ?? defaults.whitespace,
|
|
3989
3996
|
template: {
|
|
3990
3997
|
...options.template,
|
|
3991
3998
|
compilerOptions: {
|
|
@@ -4079,14 +4086,14 @@ function resolveScopes(config, scopes, file) {
|
|
|
4079
4086
|
}
|
|
4080
4087
|
return compiler;
|
|
4081
4088
|
}
|
|
4082
|
-
function createFileCompilerOptions(config, root, explicit) {
|
|
4089
|
+
function createFileCompilerOptions(config, root, explicit, defaults = {}) {
|
|
4083
4090
|
if (!config) return void 0;
|
|
4084
4091
|
const scopes = compileScopes(config, root);
|
|
4085
4092
|
if (scopes.length === 0) return void 0;
|
|
4086
4093
|
return (file) => mergeCompilerOptions(explicit, {
|
|
4087
4094
|
...config,
|
|
4088
4095
|
compiler: resolveScopes(config, scopes, file)
|
|
4089
|
-
});
|
|
4096
|
+
}, defaults);
|
|
4090
4097
|
}
|
|
4091
4098
|
//#endregion
|
|
4092
4099
|
//#region src/plugin/config-lifecycle.ts
|
|
@@ -4177,7 +4184,8 @@ function resolveVueFeatureDefines(features, define) {
|
|
|
4177
4184
|
}
|
|
4178
4185
|
//#endregion
|
|
4179
4186
|
//#region src/plugin/index.ts
|
|
4180
|
-
|
|
4187
|
+
/** Framework-derived defaults yield to project, entry, and explicit plugin options. */
|
|
4188
|
+
function vize(options = {}, compilerDefaults = {}) {
|
|
4181
4189
|
if (isLegacyVueCompatibilityMode(options)) return [createLegacyVueCompatibilityPlugin(options)];
|
|
4182
4190
|
const state = {
|
|
4183
4191
|
cache: new CompiledModuleCache(),
|
|
@@ -4196,7 +4204,10 @@ function vize(options = {}) {
|
|
|
4196
4204
|
scanPatterns: null,
|
|
4197
4205
|
precompileBatchSize: 128,
|
|
4198
4206
|
ignorePatterns: [],
|
|
4199
|
-
mergedOptions: options
|
|
4207
|
+
mergedOptions: compilerDefaults.whitespace === void 0 ? options : {
|
|
4208
|
+
...options,
|
|
4209
|
+
whitespace: options.whitespace ?? compilerDefaults.whitespace
|
|
4210
|
+
},
|
|
4200
4211
|
initialized: false,
|
|
4201
4212
|
dynamicImportAliasRules: [],
|
|
4202
4213
|
cssAliasRules: [],
|
|
@@ -4244,8 +4255,8 @@ function vize(options = {}) {
|
|
|
4244
4255
|
};
|
|
4245
4256
|
const sharedConfigPromise = resolveSharedConfig(options, state.root, configEnv, state.logger);
|
|
4246
4257
|
const sharedConfig = await register(resolvedConfig, state.root, sharedConfigPromise);
|
|
4247
|
-
state.mergedOptions = mergeCompilerOptions(options, sharedConfig);
|
|
4248
|
-
state.fileCompilerOptions = createFileCompilerOptions(sharedConfig, state.root, options);
|
|
4258
|
+
state.mergedOptions = mergeCompilerOptions(options, sharedConfig, compilerDefaults);
|
|
4259
|
+
state.fileCompilerOptions = createFileCompilerOptions(sharedConfig, state.root, options, compilerDefaults);
|
|
4249
4260
|
state.compilerScopeIdentity = sharedConfig?.entries;
|
|
4250
4261
|
state.dynamicImportAliasRules = [];
|
|
4251
4262
|
for (const alias of resolvedConfig.resolve.alias) {
|
|
@@ -109,6 +109,10 @@ function relocateTaskConfig(config, root) {
|
|
|
109
109
|
return {
|
|
110
110
|
...config,
|
|
111
111
|
basePath: path.resolve(root, config.basePath ?? ""),
|
|
112
|
+
typeChecker: config.typeChecker ? {
|
|
113
|
+
...config.typeChecker,
|
|
114
|
+
tsconfig: config.typeChecker.tsconfig === void 0 ? void 0 : path.resolve(root, config.typeChecker.tsconfig)
|
|
115
|
+
} : void 0,
|
|
112
116
|
ignores: config.ignores?.map(absolutePattern),
|
|
113
117
|
entries: (config.entries ?? []).map((entry) => ({
|
|
114
118
|
...entry,
|
|
@@ -225,6 +225,9 @@ interface LinterConfig {
|
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
227
|
interface LintRuleOptions {
|
|
228
|
+
"html/no-empty-palpable-content"?: {
|
|
229
|
+
contentDirectives?: string[];
|
|
230
|
+
};
|
|
228
231
|
"type/strict-boolean-expressions"?: {
|
|
229
232
|
allowString?: boolean;
|
|
230
233
|
allowNumber?: boolean;
|
|
@@ -1182,6 +1185,8 @@ interface VizeOptions extends ExperimentalPluginOptions {
|
|
|
1182
1185
|
* @default false
|
|
1183
1186
|
*/
|
|
1184
1187
|
vapor?: boolean;
|
|
1188
|
+
/** Extract Nuxt page metadata; the Nuxt integration enables this explicitly. */
|
|
1189
|
+
nuxtPageMeta?: boolean;
|
|
1185
1190
|
/**
|
|
1186
1191
|
* Default output mode for `.jsx`/`.tsx` components without a `"use vue:*"`
|
|
1187
1192
|
* directive. Distinct from `vapor` (which targets `.vue` SFCs): a project can
|
package/dist/vite-plus.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as LinterConfig, g as FormatterConfig, h as CompilerConfig, m as UserConfigExport, p as UserConfig$1, t as VizeOptions, v as TypeCheckerConfig } from "./types-
|
|
1
|
+
import { _ as LinterConfig, g as FormatterConfig, h as CompilerConfig, m as UserConfigExport, p as UserConfig$1, t as VizeOptions, v as TypeCheckerConfig } from "./types-CW8YdI0Y.mjs";
|
|
2
2
|
import { ConfigEnv, UserConfig, defineConfig as defineConfig$1 } from "vite-plus";
|
|
3
3
|
|
|
4
4
|
//#region src/vite-plus/types.d.ts
|
package/dist/vite-plus.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as resolveConfigExport, r as loadConfig } from "./config-PP6EAmWc.mjs";
|
|
2
2
|
import { t as mergeSharedConfig } from "./shared-config-dMxrrTkb.mjs";
|
|
3
|
-
import { a as sourceConfigKey, i as resolveVitePlus, o as taskConfigKey, r as availableVueRules, t as runNative } from "./runner-
|
|
3
|
+
import { a as sourceConfigKey, i as resolveVitePlus, o as taskConfigKey, r as availableVueRules, t as runNative } from "./runner-BewZHurL.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { readFileSync } from "node:fs";
|
|
@@ -326,7 +326,7 @@ function defineConfig(config = {}, integration = {}) {
|
|
|
326
326
|
const { options } = metadata;
|
|
327
327
|
const plugins = compiler === false ? [...vp.plugins ?? []] : await withoutVueCompiler(vp.plugins ?? []);
|
|
328
328
|
if (compiler !== false) {
|
|
329
|
-
const { vize } = await import("./plugin-
|
|
329
|
+
const { vize } = await import("./plugin-C8JA-lhE.mjs");
|
|
330
330
|
plugins.push(vize({
|
|
331
331
|
...compiler,
|
|
332
332
|
configMode: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizejs/vite-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.434.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.434.0",
|
|
55
|
+
"@vizejs/unplugin": "0.434.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.434.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@types/node": "25.9.2",
|
package/dist/plugin-9jvcWEU8.mjs
DELETED