@vizejs/vite-plugin 0.318.0 → 0.322.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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as VizeVueVersion, c as
|
|
1
|
+
import { a as VizeVueVersion, c as VizeInspectorLintPlanRequest, d as LoadConfigOptions, f as ResolvedVizeConfig, i as VizeOptions, l as VizeInspectorOptions, m as VizeConfig, n as MacroArtifact, o as VizeVueFeatures, p as UserConfigExport, r as VizeCompatibilityOptions, s as VizeInspectorLintPlanProvider, t as CompiledModule, u as ConfigEnv } from "./types-dAZFEbN_.mjs";
|
|
2
2
|
import { Plugin } from "vite";
|
|
3
3
|
|
|
4
4
|
//#region src/virtual.d.ts
|
|
@@ -40,4 +40,4 @@ declare const __internal: {
|
|
|
40
40
|
rewriteStaticAssetUrls: typeof rewriteStaticAssetUrls;
|
|
41
41
|
};
|
|
42
42
|
//#endregion
|
|
43
|
-
export { type CompiledModule, type LoadConfigOptions, type MacroArtifact, type ResolvedVizeConfig, type UserConfigExport, VIZE_CONFIG_FILE_ENV, type VizeCompatibilityOptions, type VizeConfig, type VizeInspectorLintPlanProvider, type VizeInspectorLintPlanRequest, type VizeInspectorOptions, type VizeOptions, type VizeVueVersion, __internal, rewriteStaticAssetUrls as __internal_rewriteStaticAssetUrls, vize as default, vize, defineConfig, loadConfig, resolveConfigExport, vizeConfigStore };
|
|
43
|
+
export { type CompiledModule, type LoadConfigOptions, type MacroArtifact, type ResolvedVizeConfig, type UserConfigExport, VIZE_CONFIG_FILE_ENV, type VizeCompatibilityOptions, type VizeConfig, type VizeInspectorLintPlanProvider, type VizeInspectorLintPlanRequest, type VizeInspectorOptions, type VizeOptions, type VizeVueFeatures, type VizeVueVersion, __internal, rewriteStaticAssetUrls as __internal_rewriteStaticAssetUrls, vize as default, vize, defineConfig, loadConfig, resolveConfigExport, vizeConfigStore };
|
package/dist/index.mjs
CHANGED
|
@@ -1028,6 +1028,7 @@ function compileJsxModule(filePath, source, options = {}) {
|
|
|
1028
1028
|
filename: filePath,
|
|
1029
1029
|
lang: filePath.endsWith(".tsx") ? "tsx" : "jsx",
|
|
1030
1030
|
jsxMode: options.jsxMode,
|
|
1031
|
+
jsxCompat: options.jsxCompat,
|
|
1031
1032
|
vapor: options.vapor ?? false,
|
|
1032
1033
|
sourceMap: options.sourceMap ?? false
|
|
1033
1034
|
});
|
|
@@ -2697,6 +2698,7 @@ function transformJsxRequest(state, code, id, options) {
|
|
|
2697
2698
|
const sourceMap = getCompileOptionsForRequest(state, ssr).sourceMap;
|
|
2698
2699
|
const { code: compiled, map, warnings } = compileJsxModule(realPath, code, {
|
|
2699
2700
|
jsxMode: state.mergedOptions.jsxMode,
|
|
2701
|
+
jsxCompat: state.mergedOptions.jsxCompat,
|
|
2700
2702
|
vapor: state.mergedOptions.vapor ?? false,
|
|
2701
2703
|
ssr,
|
|
2702
2704
|
sourceMap
|
|
@@ -3329,6 +3331,7 @@ function resolveExperimentalCompilerOptions(options, compilerConfig, config) {
|
|
|
3329
3331
|
return {
|
|
3330
3332
|
vapor: options.vapor ?? compilerConfig?.vapor ?? experimentals.vapor,
|
|
3331
3333
|
jsxMode: options.jsxMode ?? compilerConfig?.jsxMode ?? (experimentals.jsxVapor ? "vapor" : void 0),
|
|
3334
|
+
jsxCompat: options.jsxCompat ?? compilerConfig?.jsxCompat,
|
|
3332
3335
|
experimentalInTagComments: experimentals.inTagComments,
|
|
3333
3336
|
experimentalPatternedTemplate: experimentals.patternedTemplate,
|
|
3334
3337
|
experimentalServerScript: experimentals.serverScript
|
|
@@ -3526,6 +3529,19 @@ function unregisterBuild(context) {
|
|
|
3526
3529
|
if (resolvedConfig) unregisterConfig(resolvedConfig);
|
|
3527
3530
|
}
|
|
3528
3531
|
//#endregion
|
|
3532
|
+
//#region src/plugin/vue-feature-defines.ts
|
|
3533
|
+
function parseDefine(value) {
|
|
3534
|
+
try {
|
|
3535
|
+
return typeof value === "string" ? JSON.parse(value) : value;
|
|
3536
|
+
} catch {
|
|
3537
|
+
return value;
|
|
3538
|
+
}
|
|
3539
|
+
}
|
|
3540
|
+
/** Resolve the Options API runtime define with plugin-vue's precedence. */
|
|
3541
|
+
function resolveOptionsApiFlag(option, define) {
|
|
3542
|
+
return option ?? parseDefine(define) ?? true;
|
|
3543
|
+
}
|
|
3544
|
+
//#endregion
|
|
3529
3545
|
//#region src/plugin/index.ts
|
|
3530
3546
|
function aliasSortKey(find) {
|
|
3531
3547
|
return typeof find === "string" ? find.length : find.source.length;
|
|
@@ -3583,9 +3599,8 @@ function vize(options = {}) {
|
|
|
3583
3599
|
config(userConfig, env) {
|
|
3584
3600
|
patchCssModuleGenerateScopedName(userConfig);
|
|
3585
3601
|
return {
|
|
3586
|
-
// @vitejs/plugin-vue normally provides them; vize must do so as its replacement.
|
|
3587
3602
|
define: {
|
|
3588
|
-
__VUE_OPTIONS_API__:
|
|
3603
|
+
__VUE_OPTIONS_API__: resolveOptionsApiFlag(options.features?.optionsAPI, userConfig.define?.__VUE_OPTIONS_API__),
|
|
3589
3604
|
__VUE_PROD_DEVTOOLS__: env.command === "serve",
|
|
3590
3605
|
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false
|
|
3591
3606
|
},
|
|
@@ -27,8 +27,16 @@ interface VizeConfig {
|
|
|
27
27
|
* Base config files or presets to compose
|
|
28
28
|
*/
|
|
29
29
|
extends?: string | string[];
|
|
30
|
+
/**
|
|
31
|
+
* Vue dialect profile for standalone HTML documents; when absent the dialect is detected structurally per document
|
|
32
|
+
*/
|
|
33
|
+
dialect?: "vue" | "petite-vue";
|
|
30
34
|
compiler?: CompilerConfig;
|
|
31
|
-
experimentals?:
|
|
35
|
+
experimentals?: {
|
|
36
|
+
[k: string]: boolean | {
|
|
37
|
+
[k: string]: unknown;
|
|
38
|
+
} | null;
|
|
39
|
+
};
|
|
32
40
|
vite?: VitePluginConfig;
|
|
33
41
|
linter?: LinterConfig;
|
|
34
42
|
typeChecker?: TypeCheckerConfig;
|
|
@@ -58,6 +66,10 @@ interface CompilerConfig {
|
|
|
58
66
|
* Default output mode for .jsx/.tsx components without a "use vue:*" directive
|
|
59
67
|
*/
|
|
60
68
|
jsxMode?: "vdom" | "vapor";
|
|
69
|
+
/**
|
|
70
|
+
* JSX semantics for projects migrating from @vue/babel-plugin-jsx
|
|
71
|
+
*/
|
|
72
|
+
jsxCompat?: "native" | "babel";
|
|
61
73
|
/**
|
|
62
74
|
* Treat lowercase non-HTML tags as custom renderer elements
|
|
63
75
|
*/
|
|
@@ -122,11 +134,11 @@ interface CompilerCompatibilityConfig {
|
|
|
122
134
|
*/
|
|
123
135
|
optionsApiVapor?: boolean;
|
|
124
136
|
/**
|
|
125
|
-
*
|
|
137
|
+
* Nuxt major line for opt-in Nuxt compatibility behavior
|
|
126
138
|
*/
|
|
127
139
|
nuxtVersion?: 2 | 3 | 4;
|
|
128
140
|
/**
|
|
129
|
-
*
|
|
141
|
+
* webpack major line for opt-in bundler compatibility behavior
|
|
130
142
|
*/
|
|
131
143
|
webpackVersion?: 4 | 5;
|
|
132
144
|
}
|
|
@@ -156,9 +168,13 @@ interface LinterConfig {
|
|
|
156
168
|
* Enable linting
|
|
157
169
|
*/
|
|
158
170
|
enabled?: boolean;
|
|
159
|
-
/**
|
|
171
|
+
/**
|
|
172
|
+
* Built-in lint preset
|
|
173
|
+
*/
|
|
160
174
|
preset?: "happy-path" | "opinionated" | "essential" | "incremental" | "ecosystem" | "nuxt";
|
|
161
|
-
/**
|
|
175
|
+
/**
|
|
176
|
+
* Enable native type-aware lint rules from the active lint configuration
|
|
177
|
+
*/
|
|
162
178
|
typeAware?: boolean;
|
|
163
179
|
/**
|
|
164
180
|
* Rules to enable/disable
|
|
@@ -166,6 +182,7 @@ interface LinterConfig {
|
|
|
166
182
|
rules?: {
|
|
167
183
|
[k: string]: "off" | "warn" | "error";
|
|
168
184
|
};
|
|
185
|
+
ruleOptions?: LintRuleOptions;
|
|
169
186
|
/**
|
|
170
187
|
* Category-level severity overrides
|
|
171
188
|
*/
|
|
@@ -178,6 +195,25 @@ interface LinterConfig {
|
|
|
178
195
|
security?: "off" | "warn" | "error";
|
|
179
196
|
};
|
|
180
197
|
}
|
|
198
|
+
interface LintRuleOptions {
|
|
199
|
+
"script/no-restricted-globals"?: NoRestrictedGlobalsOptions;
|
|
200
|
+
"script/no-restricted-members"?: NoRestrictedMembersOptions;
|
|
201
|
+
}
|
|
202
|
+
interface NoRestrictedGlobalsOptions {
|
|
203
|
+
globals?: RestrictedGlobal[];
|
|
204
|
+
}
|
|
205
|
+
interface RestrictedGlobal {
|
|
206
|
+
name: string;
|
|
207
|
+
message?: string;
|
|
208
|
+
}
|
|
209
|
+
interface NoRestrictedMembersOptions {
|
|
210
|
+
members?: RestrictedMember[];
|
|
211
|
+
}
|
|
212
|
+
interface RestrictedMember {
|
|
213
|
+
object: string;
|
|
214
|
+
property: string;
|
|
215
|
+
message?: string;
|
|
216
|
+
}
|
|
181
217
|
interface TypeCheckerConfig {
|
|
182
218
|
/**
|
|
183
219
|
* Enable type checking
|
|
@@ -215,7 +251,9 @@ interface TypeCheckerConfig {
|
|
|
215
251
|
* Check fallthrough attrs on multi-root templates
|
|
216
252
|
*/
|
|
217
253
|
checkFallthroughAttrs?: boolean;
|
|
218
|
-
/**
|
|
254
|
+
/**
|
|
255
|
+
* Resolve Vue 3 Options API template bindings during type checking
|
|
256
|
+
*/
|
|
219
257
|
optionsApi?: boolean;
|
|
220
258
|
/**
|
|
221
259
|
* Enable Vue 2.7 / Nuxt 2 Options API template binding support
|
|
@@ -229,7 +267,9 @@ interface TypeCheckerConfig {
|
|
|
229
267
|
* Path to tsconfig.json
|
|
230
268
|
*/
|
|
231
269
|
tsconfig?: string;
|
|
232
|
-
/**
|
|
270
|
+
/**
|
|
271
|
+
* Path to the Corsa executable. This is the canonical runtime key; tsgoPath is kept as a compatibility alias.
|
|
272
|
+
*/
|
|
233
273
|
corsaPath?: string;
|
|
234
274
|
/**
|
|
235
275
|
* Deprecated alias for typeChecker.corsaPath
|
|
@@ -564,8 +604,16 @@ interface VizeConfigEntry {
|
|
|
564
604
|
* Base config files or presets to compose
|
|
565
605
|
*/
|
|
566
606
|
extends?: string | string[];
|
|
607
|
+
/**
|
|
608
|
+
* Vue dialect profile for standalone HTML documents; when absent the dialect is detected structurally per document
|
|
609
|
+
*/
|
|
610
|
+
dialect?: "vue" | "petite-vue";
|
|
567
611
|
compiler?: CompilerConfig;
|
|
568
|
-
experimentals?:
|
|
612
|
+
experimentals?: {
|
|
613
|
+
[k: string]: boolean | {
|
|
614
|
+
[k: string]: unknown;
|
|
615
|
+
} | null;
|
|
616
|
+
};
|
|
569
617
|
vite?: VitePluginConfig;
|
|
570
618
|
linter?: LinterConfig;
|
|
571
619
|
typeChecker?: TypeCheckerConfig;
|
|
@@ -673,6 +721,17 @@ interface VizeInspectorOptions {
|
|
|
673
721
|
lintPlan?: VizeInspectorLintPlanProvider;
|
|
674
722
|
}
|
|
675
723
|
//#endregion
|
|
724
|
+
//#region src/vue-features.d.ts
|
|
725
|
+
/** Vue runtime feature flags shared with `@vitejs/plugin-vue`. */
|
|
726
|
+
interface VizeVueFeatures {
|
|
727
|
+
/**
|
|
728
|
+
* Set to `false` to allow Vue's Options API code to be tree-shaken from
|
|
729
|
+
* production bundles.
|
|
730
|
+
* @default true
|
|
731
|
+
*/
|
|
732
|
+
optionsAPI?: boolean;
|
|
733
|
+
}
|
|
734
|
+
//#endregion
|
|
676
735
|
//#region src/utils/module-output.d.ts
|
|
677
736
|
type ModuleOutputInfo = {
|
|
678
737
|
hasDefaultExport: boolean;
|
|
@@ -741,6 +800,8 @@ interface VizeOptions extends ExperimentalPluginOptions {
|
|
|
741
800
|
config?: UserConfigExport;
|
|
742
801
|
/** Development inspector integrations exposed through Vite's dev server. */
|
|
743
802
|
inspector?: VizeInspectorOptions;
|
|
803
|
+
/** Vue runtime feature flags compatible with `@vitejs/plugin-vue`. */
|
|
804
|
+
features?: VizeVueFeatures;
|
|
744
805
|
/**
|
|
745
806
|
* Vue major version for the host project.
|
|
746
807
|
*
|
|
@@ -810,6 +871,13 @@ interface VizeOptions extends ExperimentalPluginOptions {
|
|
|
810
871
|
* @default "vdom"
|
|
811
872
|
*/
|
|
812
873
|
jsxMode?: "vdom" | "vapor";
|
|
874
|
+
/**
|
|
875
|
+
* JSX semantics for projects migrating from `@vue/babel-plugin-jsx`.
|
|
876
|
+
* `"native"` keeps Vize's defaults; `"babel"` opts into Babel-compatible
|
|
877
|
+
* behavior. Babel compatibility is only defined for VDOM output.
|
|
878
|
+
* @default "native"
|
|
879
|
+
*/
|
|
880
|
+
jsxCompat?: "native" | "babel";
|
|
813
881
|
/**
|
|
814
882
|
* Treat lowercase non-HTML tags as custom renderer elements instead of Vue components.
|
|
815
883
|
* Useful for TresJS and other custom renderers.
|
|
@@ -913,4 +981,4 @@ interface CompiledModule {
|
|
|
913
981
|
moduleShape?: ModuleOutputInfo;
|
|
914
982
|
}
|
|
915
983
|
//#endregion
|
|
916
|
-
export { VizeVueVersion as a,
|
|
984
|
+
export { VizeVueVersion as a, VizeInspectorLintPlanRequest as c, LoadConfigOptions as d, ResolvedVizeConfig as f, VizeOptions as i, VizeInspectorOptions as l, VizeConfig as m, MacroArtifact as n, VizeVueFeatures as o, UserConfigExport as p, VizeCompatibilityOptions as r, VizeInspectorLintPlanProvider as s, CompiledModule as t, ConfigEnv as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizejs/vite-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.322.0",
|
|
4
4
|
"description": "High-performance native Vite plugin for Vue SFC compilation powered by Vize",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compiler",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@vizejs/native": "0.
|
|
48
|
+
"@vizejs/native": "0.322.0",
|
|
49
49
|
"oxc-parser": "0.133.0",
|
|
50
50
|
"tinyglobby": "0.2.16",
|
|
51
|
-
"vize": "0.
|
|
51
|
+
"vize": "0.322.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/node": "25.9.2",
|