vite 7.1.5 → 7.1.6
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/LICENSE.md +2 -31
- package/dist/client/client.mjs +12 -17
- package/dist/node/chunks/{dep-Cs9lwdKu.js → dep-4S5XG83Z.js} +1 -1
- package/dist/node/chunks/{dep-cWFO4sv4.js → dep-BLFux7-m.js} +1 -1
- package/dist/node/chunks/{dep-D_YDhiNx.js → dep-BTc4Fpfo.js} +1 -1
- package/dist/node/chunks/{dep-BvyJBvVx.js → dep-BthugQ6r.js} +1 -1
- package/dist/node/chunks/dep-C7LYi1xl.js +4 -0
- package/dist/node/chunks/{dep-sDKrrA4S.js → dep-CCSnTAeo.js} +22 -75
- package/dist/node/chunks/{dep-DDbTn5rw.js → dep-CwrJo3zV.js} +5 -8
- package/dist/node/chunks/{dep-M_KD0XSK.js → dep-D5b0Zz6C.js} +497 -904
- package/dist/node/chunks/{dep-DCVhRpiz.js → dep-D8ZQhg7-.js} +57 -118
- package/dist/node/cli.js +11 -18
- package/dist/node/index.d.ts +0 -36
- package/dist/node/index.js +1 -1
- package/dist/node/module-runner.d.ts +0 -5
- package/dist/node/module-runner.js +21 -28
- package/package.json +9 -9
- package/types/importMeta.d.ts +1 -2
- package/dist/node/chunks/dep-yxQqhtZq.js +0 -4
package/dist/node/cli.js
CHANGED
@@ -110,10 +110,9 @@ const getMriOptions = (options) => {
|
|
110
110
|
for (const [index, option] of options.entries()) {
|
111
111
|
if (option.names.length > 1) result.alias[option.names[0]] = option.names.slice(1);
|
112
112
|
if (option.isBoolean) if (option.negated) {
|
113
|
-
|
113
|
+
if (!options.some((o, i) => {
|
114
114
|
return i !== index && o.names.some((name) => option.names.includes(name)) && typeof o.required === "boolean";
|
115
|
-
});
|
116
|
-
if (!hasStringTypeOption) result.boolean.push(option.names[0]);
|
115
|
+
})) result.boolean.push(option.names[0]);
|
117
116
|
} else result.boolean.push(option.names[0]);
|
118
117
|
}
|
119
118
|
return result;
|
@@ -260,8 +259,7 @@ var Command = class {
|
|
260
259
|
title: "Usage",
|
261
260
|
body: ` $ ${name} ${this.usageText || this.rawName}`
|
262
261
|
});
|
263
|
-
|
264
|
-
if (showCommands) {
|
262
|
+
if ((this.isGlobalCommand || this.isDefaultCommand) && commands.length > 0) {
|
265
263
|
const longestCommandName = findLongest(commands.map((command) => command.rawName));
|
266
264
|
sections.push({
|
267
265
|
title: "Commands",
|
@@ -494,8 +492,7 @@ function checkNodeVersion(nodeVersion) {
|
|
494
492
|
const currentVersion = nodeVersion.split(".");
|
495
493
|
const major = parseInt(currentVersion[0], 10);
|
496
494
|
const minor = parseInt(currentVersion[1], 10);
|
497
|
-
|
498
|
-
return isSupported;
|
495
|
+
return major === 20 && minor >= 19 || major === 22 && minor >= 12 || major > 22;
|
499
496
|
}
|
500
497
|
if (!checkNodeVersion(process.versions.node)) console.warn(import_picocolors.default.yellow(`You are using Node.js ${process.versions.node}. Vite requires Node.js version 20.19+ or 22.12+. Please upgrade your Node.js version.`));
|
501
498
|
const cli = cac("vite");
|
@@ -543,10 +540,7 @@ function cleanGlobalCLIOptions(options) {
|
|
543
540
|
const sourcemap = ret.sourcemap;
|
544
541
|
ret.sourcemap = sourcemap === "true" ? true : sourcemap === "false" ? false : ret.sourcemap;
|
545
542
|
}
|
546
|
-
if ("watch" in ret) {
|
547
|
-
const watch = ret.watch;
|
548
|
-
ret.watch = watch ? {} : void 0;
|
549
|
-
}
|
543
|
+
if ("watch" in ret) ret.watch = ret.watch ? {} : void 0;
|
550
544
|
return ret;
|
551
545
|
}
|
552
546
|
/**
|
@@ -574,7 +568,7 @@ const convertBase = (v) => {
|
|
574
568
|
cli.option("-c, --config <file>", `[string] use specified config file`).option("--base <path>", `[string] public base path (default: /)`, { type: [convertBase] }).option("-l, --logLevel <level>", `[string] info | warn | error | silent`).option("--clearScreen", `[boolean] allow/disable clear screen when logging`).option("--configLoader <loader>", `[string] use 'bundle' to bundle the config with esbuild, or 'runner' (experimental) to process it on the fly, or 'native' (experimental) to load using the native runtime (default: bundle)`).option("-d, --debug [feat]", `[string | boolean] show debug logs`).option("-f, --filter <filter>", `[string] filter debug logs`).option("-m, --mode <mode>", `[string] set env mode`);
|
575
569
|
cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--host [host]", `[string] specify hostname`, { type: [convertHost] }).option("--port <port>", `[number] specify port`).option("--open [path]", `[boolean | string] open browser on startup`).option("--cors", `[boolean] enable CORS`).option("--strictPort", `[boolean] exit if specified port is already in use`).option("--force", `[boolean] force the optimizer to ignore the cache and re-bundle`).action(async (root, options) => {
|
576
570
|
filterDuplicateOptions(options);
|
577
|
-
const { createServer } = await import("./chunks/dep-
|
571
|
+
const { createServer } = await import("./chunks/dep-BTc4Fpfo.js");
|
578
572
|
try {
|
579
573
|
const server = await createServer({
|
580
574
|
root,
|
@@ -630,7 +624,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
|
|
630
624
|
});
|
631
625
|
cli.command("build [root]", "build for production").option("--target <target>", `[string] transpile target (default: 'baseline-widely-available')`).option("--outDir <dir>", `[string] output directory (default: dist)`).option("--assetsDir <dir>", `[string] directory under outDir to place assets in (default: assets)`).option("--assetsInlineLimit <number>", `[number] static asset base64 inline threshold in bytes (default: 4096)`).option("--ssr [entry]", `[string] build specified entry for server-side rendering`).option("--sourcemap [output]", `[boolean | "inline" | "hidden"] output source maps for build (default: false)`).option("--minify [minifier]", "[boolean | \"terser\" | \"esbuild\"] enable/disable minification, or specify minifier to use (default: esbuild)").option("--manifest [name]", `[boolean | string] emit build manifest json`).option("--ssrManifest [name]", `[boolean | string] emit ssr manifest json`).option("--emptyOutDir", `[boolean] force empty outDir when it's outside of root`).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as \`builder: {}\``).action(async (root, options) => {
|
632
626
|
filterDuplicateOptions(options);
|
633
|
-
const { createBuilder } = await import("./chunks/dep-
|
627
|
+
const { createBuilder } = await import("./chunks/dep-BthugQ6r.js");
|
634
628
|
const buildOptions = cleanGlobalCLIOptions(cleanBuilderCLIOptions(options));
|
635
629
|
try {
|
636
630
|
const inlineConfig = {
|
@@ -644,8 +638,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
644
638
|
build: buildOptions,
|
645
639
|
...options.app ? { builder: {} } : {}
|
646
640
|
};
|
647
|
-
|
648
|
-
await builder.buildApp();
|
641
|
+
await (await createBuilder(inlineConfig, null)).buildApp();
|
649
642
|
} catch (e) {
|
650
643
|
createLogger(options.logLevel).error(import_picocolors.default.red(`error during build:\n${e.stack}`), { error: e });
|
651
644
|
process.exit(1);
|
@@ -655,8 +648,8 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
655
648
|
});
|
656
649
|
cli.command("optimize [root]", "pre-bundle dependencies (deprecated, the pre-bundle process runs automatically and does not need to be called)").option("--force", `[boolean] force the optimizer to ignore the cache and re-bundle`).action(async (root, options) => {
|
657
650
|
filterDuplicateOptions(options);
|
658
|
-
const { resolveConfig } = await import("./chunks/dep-
|
659
|
-
const { optimizeDeps } = await import("./chunks/dep-
|
651
|
+
const { resolveConfig } = await import("./chunks/dep-4S5XG83Z.js");
|
652
|
+
const { optimizeDeps } = await import("./chunks/dep-BLFux7-m.js");
|
660
653
|
try {
|
661
654
|
const config = await resolveConfig({
|
662
655
|
root,
|
@@ -674,7 +667,7 @@ cli.command("optimize [root]", "pre-bundle dependencies (deprecated, the pre-bun
|
|
674
667
|
});
|
675
668
|
cli.command("preview [root]", "locally preview production build").option("--host [host]", `[string] specify hostname`, { type: [convertHost] }).option("--port <port>", `[number] specify port`).option("--strictPort", `[boolean] exit if specified port is already in use`).option("--open [path]", `[boolean | string] open browser on startup`).option("--outDir <dir>", `[string] output directory (default: dist)`).action(async (root, options) => {
|
676
669
|
filterDuplicateOptions(options);
|
677
|
-
const { preview } = await import("./chunks/dep-
|
670
|
+
const { preview } = await import("./chunks/dep-C7LYi1xl.js");
|
678
671
|
try {
|
679
672
|
const server = await preview({
|
680
673
|
root,
|
package/dist/node/index.d.ts
CHANGED
@@ -45,7 +45,6 @@ interface ResolverObject {
|
|
45
45
|
buildStart?: PluginHooks['buildStart'];
|
46
46
|
resolveId: ResolverFunction;
|
47
47
|
}
|
48
|
-
|
49
48
|
/**
|
50
49
|
* Specifies an `Object`, or an `Array` of `Object`,
|
51
50
|
* which defines aliases used to replace values in `import` or `require` statements.
|
@@ -246,10 +245,6 @@ interface AwaitWriteFinishOptions {
|
|
246
245
|
*/
|
247
246
|
pollInterval?: number;
|
248
247
|
}
|
249
|
-
|
250
|
-
/**
|
251
|
-
* produces an instance of `FSWatcher`.
|
252
|
-
*/
|
253
248
|
//#endregion
|
254
249
|
//#region src/types/connect.d.ts
|
255
250
|
declare namespace Connect {
|
@@ -3456,11 +3451,6 @@ interface PluginHookUtils {
|
|
3456
3451
|
}
|
3457
3452
|
type ResolveFn = (id: string, importer?: string, aliasOnly?: boolean, ssr?: boolean) => Promise<string | undefined>;
|
3458
3453
|
declare function resolveConfig(inlineConfig: InlineConfig, command: 'build' | 'serve', defaultMode?: string, defaultNodeEnv?: string, isPreview?: boolean, ): Promise<ResolvedConfig>;
|
3459
|
-
/**
|
3460
|
-
* Resolve base url. Note that some users use Vite to build for non-web targets like
|
3461
|
-
* electron or expects to deploy
|
3462
|
-
*/
|
3463
|
-
|
3464
3454
|
declare function sortUserPlugins(plugins: (Plugin$1 | Plugin$1[])[] | undefined): [Plugin$1[], Plugin$1[], Plugin$1[]];
|
3465
3455
|
declare function loadConfigFromFile(configEnv: ConfigEnv, configFile?: string, configRoot?: string, logLevel?: LogLevel, customLogger?: Logger, configLoader?: 'bundle' | 'runner' | 'native'): Promise<{
|
3466
3456
|
path: string;
|
@@ -3470,12 +3460,6 @@ declare function loadConfigFromFile(configEnv: ConfigEnv, configFile?: string, c
|
|
3470
3460
|
//#endregion
|
3471
3461
|
//#region src/node/idResolver.d.ts
|
3472
3462
|
type ResolveIdFn = (environment: PartialEnvironment, id: string, importer?: string, aliasOnly?: boolean) => Promise<string | undefined>;
|
3473
|
-
/**
|
3474
|
-
* Some projects like Astro were overriding config.createResolver to add a custom
|
3475
|
-
* alias plugin. For the client and ssr environments, we root through it to avoid
|
3476
|
-
* breaking changes for now.
|
3477
|
-
*/
|
3478
|
-
|
3479
3463
|
/**
|
3480
3464
|
* Create an internal resolver to be used in special scenarios, e.g.
|
3481
3465
|
* optimizer and handling css @imports
|
@@ -3576,22 +3560,9 @@ declare function ssrTransform(code: string, inMap: SourceMap | {
|
|
3576
3560
|
declare const VERSION: string;
|
3577
3561
|
declare const DEFAULT_CLIENT_MAIN_FIELDS: readonly string[];
|
3578
3562
|
declare const DEFAULT_SERVER_MAIN_FIELDS: readonly string[];
|
3579
|
-
/**
|
3580
|
-
* A special condition that would be replaced with production or development
|
3581
|
-
* depending on NODE_ENV env variable
|
3582
|
-
*/
|
3583
|
-
|
3584
3563
|
declare const DEFAULT_CLIENT_CONDITIONS: readonly string[];
|
3585
3564
|
declare const DEFAULT_SERVER_CONDITIONS: readonly string[];
|
3586
3565
|
declare const DEFAULT_EXTERNAL_CONDITIONS: readonly string[];
|
3587
|
-
/**
|
3588
|
-
* The browser versions that are included in the Baseline Widely Available on 2025-05-01.
|
3589
|
-
*
|
3590
|
-
* This value would be bumped on each major release of Vite.
|
3591
|
-
*
|
3592
|
-
* The value is generated by `pnpm generate-target` script.
|
3593
|
-
*/
|
3594
|
-
|
3595
3566
|
declare const defaultAllowedOrigins: RegExp;
|
3596
3567
|
//#endregion
|
3597
3568
|
//#region src/node/utils.d.ts
|
@@ -3632,13 +3603,6 @@ declare function searchForWorkspaceRoot(current: string, root?: string): string;
|
|
3632
3603
|
*/
|
3633
3604
|
declare function isFileServingAllowed(config: ResolvedConfig, url: string): boolean;
|
3634
3605
|
declare function isFileServingAllowed(url: string, server: ViteDevServer): boolean;
|
3635
|
-
/**
|
3636
|
-
* Warning: parameters are not validated, only works with normalized absolute paths
|
3637
|
-
*
|
3638
|
-
* @param targetPath - normalized absolute path
|
3639
|
-
* @param filePath - normalized absolute path
|
3640
|
-
*/
|
3641
|
-
|
3642
3606
|
/**
|
3643
3607
|
* Warning: parameters are not validated, only works with normalized absolute paths
|
3644
3608
|
*/
|
package/dist/node/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { DEFAULT_CLIENT_CONDITIONS, DEFAULT_CLIENT_MAIN_FIELDS, DEFAULT_EXTERNAL_CONDITIONS, DEFAULT_SERVER_CONDITIONS, DEFAULT_SERVER_MAIN_FIELDS, VERSION, createLogger, defaultAllowedOrigins } from "./chunks/dep-SmwnYDP9.js";
|
2
|
-
import { BuildEnvironment, DevEnvironment, build, buildErrorMessage, createBuilder, createFilter, createIdResolver, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, normalizePath, optimizeDeps, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, ssrTransform, transformWithEsbuild } from "./chunks/dep-
|
2
|
+
import { BuildEnvironment, DevEnvironment, build, buildErrorMessage, createBuilder, createFilter, createIdResolver, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, normalizePath, optimizeDeps, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, ssrTransform, transformWithEsbuild } from "./chunks/dep-D5b0Zz6C.js";
|
3
3
|
import { parseAst, parseAstAsync } from "rollup/parseAst";
|
4
4
|
import { version as esbuildVersion } from "esbuild";
|
5
5
|
|
@@ -86,11 +86,6 @@ interface DefineImportMetadata {
|
|
86
86
|
interface SSRImportMetadata extends DefineImportMetadata {
|
87
87
|
isDynamicImport?: boolean;
|
88
88
|
}
|
89
|
-
/**
|
90
|
-
* Vite converts `import { } from 'foo'` to `const _ = __vite_ssr_import__('foo')`.
|
91
|
-
* Top-level imports and dynamic imports work slightly differently in Node.js.
|
92
|
-
* This function normalizes the differences so it matches prod behaviour.
|
93
|
-
*/
|
94
89
|
//#endregion
|
95
90
|
//#region src/module-runner/constants.d.ts
|
96
91
|
declare const ssrModuleExportsKey = "__vite_ssr_exports__";
|
@@ -25,11 +25,11 @@ function getAsyncFunctionDeclarationPaddingLineCount() {
|
|
25
25
|
return asyncFunctionDeclarationPaddingLineCount;
|
26
26
|
}
|
27
27
|
function promiseWithResolvers() {
|
28
|
-
let resolve$1, reject
|
29
|
-
resolve$1 = _resolve, reject = _reject;
|
30
|
-
});
|
28
|
+
let resolve$1, reject;
|
31
29
|
return {
|
32
|
-
promise,
|
30
|
+
promise: new Promise((_resolve, _reject) => {
|
31
|
+
resolve$1 = _resolve, reject = _reject;
|
32
|
+
}),
|
33
33
|
resolve: resolve$1,
|
34
34
|
reject
|
35
35
|
};
|
@@ -93,9 +93,9 @@ function posixPathToFileHref(posixPath) {
|
|
93
93
|
function toWindowsPath(path) {
|
94
94
|
return path.replace(/\//g, "\\");
|
95
95
|
}
|
96
|
-
|
97
|
-
for (let i = 0; i <
|
98
|
-
let c =
|
96
|
+
var comma = 44, chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", intToChar = new Uint8Array(64), charToInt = new Uint8Array(128);
|
97
|
+
for (let i = 0; i < chars.length; i++) {
|
98
|
+
let c = chars.charCodeAt(i);
|
99
99
|
intToChar[i] = c, charToInt[c] = i;
|
100
100
|
}
|
101
101
|
function decodeInteger(reader, relative) {
|
@@ -108,7 +108,7 @@ function decodeInteger(reader, relative) {
|
|
108
108
|
return value >>>= 1, shouldNegate && (value = -2147483648 | -value), relative + value;
|
109
109
|
}
|
110
110
|
function hasMoreVlq(reader, max) {
|
111
|
-
return reader.pos >= max ? !1 : reader.peek() !==
|
111
|
+
return reader.pos >= max ? !1 : reader.peek() !== comma;
|
112
112
|
}
|
113
113
|
var StringReader = class {
|
114
114
|
constructor(buffer) {
|
@@ -297,9 +297,7 @@ const prefixedBuiltins = new Set([
|
|
297
297
|
"node:test/reporters"
|
298
298
|
]);
|
299
299
|
function normalizeModuleId(file) {
|
300
|
-
|
301
|
-
let unixFile = slash(file).replace(/^\/@fs\//, isWindows ? "" : "/").replace(/^node:/, "").replace(/^\/+/, "/");
|
302
|
-
return unixFile.replace(/^file:\/+/, isWindows ? "" : "/");
|
300
|
+
return prefixedBuiltins.has(file) ? file : slash(file).replace(/^\/@fs\//, isWindows ? "" : "/").replace(/^node:/, "").replace(/^\/+/, "/").replace(/^file:\/+/, isWindows ? "" : "/");
|
303
301
|
}
|
304
302
|
var HMRContext = class {
|
305
303
|
newListeners;
|
@@ -690,10 +688,7 @@ function createHMRHandlerForRunner(runner) {
|
|
690
688
|
break;
|
691
689
|
}
|
692
690
|
case "ping": break;
|
693
|
-
default:
|
694
|
-
let check = payload;
|
695
|
-
return check;
|
696
|
-
}
|
691
|
+
default: return payload;
|
697
692
|
}
|
698
693
|
});
|
699
694
|
}
|
@@ -732,7 +727,7 @@ function resetInterceptor(runner, options) {
|
|
732
727
|
evaluatedModulesCache.delete(runner.evaluatedModules), options.retrieveFile && retrieveFileHandlers.delete(options.retrieveFile), options.retrieveSourceMap && retrieveSourceMapHandlers.delete(options.retrieveSourceMap), evaluatedModulesCache.size === 0 && (Error.prepareStackTrace = originalPrepare, overridden = !1);
|
733
728
|
}
|
734
729
|
function interceptStackTrace(runner, options = {}) {
|
735
|
-
return overridden
|
730
|
+
return overridden ||= (Error.prepareStackTrace = prepareStackTrace, !0), evaluatedModulesCache.add(runner.evaluatedModules), options.retrieveFile && retrieveFileHandlers.add(options.retrieveFile), options.retrieveSourceMap && retrieveSourceMapHandlers.add(options.retrieveSourceMap), () => resetInterceptor(runner, options);
|
736
731
|
}
|
737
732
|
function supportRelativeURL(file, url) {
|
738
733
|
if (!file) return url;
|
@@ -833,13 +828,14 @@ function CallSiteToString() {
|
|
833
828
|
columnNumber && (fileLocation += `:${columnNumber}`);
|
834
829
|
}
|
835
830
|
}
|
836
|
-
let line = "", functionName = this.getFunctionName(), addSuffix = !0, isConstructor = this.isConstructor()
|
837
|
-
if (
|
831
|
+
let line = "", functionName = this.getFunctionName(), addSuffix = !0, isConstructor = this.isConstructor();
|
832
|
+
if (this.isToplevel() || isConstructor) isConstructor ? line += `new ${functionName || "<anonymous>"}` : functionName ? line += functionName : (line += fileLocation, addSuffix = !1);
|
833
|
+
else {
|
838
834
|
let typeName = this.getTypeName();
|
839
835
|
typeName === "[object Object]" && (typeName = "null");
|
840
836
|
let methodName = this.getMethodName();
|
841
837
|
functionName ? (typeName && functionName.indexOf(typeName) !== 0 && (line += `${typeName}.`), line += functionName, methodName && functionName.indexOf(`.${methodName}`) !== functionName.length - methodName.length - 1 && (line += ` [as ${methodName}]`)) : line += `${typeName}.${methodName || "<anonymous>"}`;
|
842
|
-
}
|
838
|
+
}
|
843
839
|
return addSuffix && (line += ` (${fileLocation})`), line;
|
844
840
|
}
|
845
841
|
function cloneCallSite(frame) {
|
@@ -887,7 +883,7 @@ function wrapCallSite(frame, state) {
|
|
887
883
|
}, frame) : frame;
|
888
884
|
}
|
889
885
|
function prepareStackTrace(error, stack) {
|
890
|
-
let
|
886
|
+
let errorString = `${error.name || "Error"}: ${error.message || ""}`, state = {
|
891
887
|
nextPosition: null,
|
892
888
|
curPosition: null
|
893
889
|
}, processedStack = [];
|
@@ -906,8 +902,7 @@ function enableSourceMapSupport(runner) {
|
|
906
902
|
var ESModulesEvaluator = class {
|
907
903
|
startOffset = getAsyncFunctionDeclarationPaddingLineCount();
|
908
904
|
async runInlinedModule(context, code) {
|
909
|
-
|
910
|
-
await initModule(context[ssrModuleExportsKey], context[ssrImportMetaKey], context[ssrImportKey], context[ssrDynamicImportKey], context[ssrExportAllKey], context[ssrExportNameKey]), Object.seal(context[ssrModuleExportsKey]);
|
905
|
+
await new AsyncFunction(ssrModuleExportsKey, ssrImportMetaKey, ssrImportKey, ssrDynamicImportKey, ssrExportAllKey, ssrExportNameKey, "\"use strict\";" + code)(context[ssrModuleExportsKey], context[ssrImportMetaKey], context[ssrImportKey], context[ssrDynamicImportKey], context[ssrExportAllKey], context[ssrExportNameKey]), Object.seal(context[ssrModuleExportsKey]);
|
911
906
|
}
|
912
907
|
runExternalModule(filepath) {
|
913
908
|
return import(filepath);
|
@@ -972,8 +967,7 @@ async function createNodeImportMeta(modulePath) {
|
|
972
967
|
...defaultMeta,
|
973
968
|
main: !1,
|
974
969
|
resolve(id, parent) {
|
975
|
-
|
976
|
-
return resolver(id, parent ?? href);
|
970
|
+
return (importMetaResolver ?? defaultMeta.resolve)(id, parent ?? href);
|
977
971
|
}
|
978
972
|
};
|
979
973
|
}
|
@@ -986,8 +980,8 @@ var ModuleRunner = class {
|
|
986
980
|
closed = !1;
|
987
981
|
constructor(options, evaluator = new ESModulesEvaluator(), debug) {
|
988
982
|
if (this.options = options, this.evaluator = evaluator, this.debug = debug, this.evaluatedModules = options.evaluatedModules ?? new EvaluatedModules(), this.transport = normalizeModuleRunnerTransport(options.transport), options.hmr !== !1) {
|
989
|
-
let optionsHmr = options.hmr ?? !0
|
990
|
-
if (this.hmrClient = new HMRClient(
|
983
|
+
let optionsHmr = options.hmr ?? !0;
|
984
|
+
if (this.hmrClient = new HMRClient(optionsHmr === !0 || optionsHmr.logger === void 0 ? hmrLogger : optionsHmr.logger === !1 ? silentConsole : optionsHmr.logger, this.transport, ({ acceptedPath }) => this.import(acceptedPath)), !this.transport.connect) throw Error("HMR is not supported by this runner transport, but `hmr` option was set to true");
|
991
985
|
this.transport.connect(createHMRHandlerForRunner(this));
|
992
986
|
} else this.transport.connect?.();
|
993
987
|
options.sourcemapInterceptor !== !1 && (this.resetSourceMapSupport = enableSourceMapSupport(this));
|
@@ -1028,8 +1022,7 @@ var ModuleRunner = class {
|
|
1028
1022
|
if (importee && importers.add(importee), (callstack.includes(moduleId) || this.isCircularModule(mod) || this.isCircularImport(importers, moduleId)) && mod.exports) return this.processImport(mod.exports, meta, metadata);
|
1029
1023
|
let debugTimer;
|
1030
1024
|
this.debug && (debugTimer = setTimeout(() => {
|
1031
|
-
|
1032
|
-
this.debug(`[module runner] module ${moduleId} takes over 2s to load.\n${getStack()}`);
|
1025
|
+
this.debug(`[module runner] module ${moduleId} takes over 2s to load.\n${(() => `stack:\n${[...callstack, moduleId].reverse().map((p) => ` - ${p}`).join("\n")}`)()}`);
|
1033
1026
|
}, 2e3));
|
1034
1027
|
try {
|
1035
1028
|
if (mod.promise) return this.processImport(await mod.promise, meta, metadata);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vite",
|
3
|
-
"version": "7.1.
|
3
|
+
"version": "7.1.6",
|
4
4
|
"type": "module",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "Evan You",
|
@@ -81,10 +81,10 @@
|
|
81
81
|
"devDependencies": {
|
82
82
|
"@babel/parser": "^7.28.4",
|
83
83
|
"@jridgewell/remapping": "^2.3.5",
|
84
|
-
"@jridgewell/trace-mapping": "^0.3.
|
85
|
-
"@oxc-project/types": "0.
|
84
|
+
"@jridgewell/trace-mapping": "^0.3.31",
|
85
|
+
"@oxc-project/types": "0.87.0",
|
86
86
|
"@polka/compression": "^1.0.0-next.25",
|
87
|
-
"@rolldown/pluginutils": "^1.0.0-beta.
|
87
|
+
"@rolldown/pluginutils": "^1.0.0-beta.37",
|
88
88
|
"@rollup/plugin-alias": "^5.1.1",
|
89
89
|
"@rollup/plugin-commonjs": "^28.0.6",
|
90
90
|
"@rollup/plugin-dynamic-import-vars": "2.1.4",
|
@@ -92,14 +92,14 @@
|
|
92
92
|
"@types/escape-html": "^1.0.4",
|
93
93
|
"@types/pnpapi": "^0.0.5",
|
94
94
|
"artichokie": "^0.4.0",
|
95
|
-
"baseline-browser-mapping": "^2.
|
95
|
+
"baseline-browser-mapping": "^2.8.3",
|
96
96
|
"cac": "^6.7.14",
|
97
97
|
"chokidar": "^3.6.0",
|
98
98
|
"connect": "^3.7.0",
|
99
99
|
"convert-source-map": "^2.0.0",
|
100
100
|
"cors": "^2.8.5",
|
101
101
|
"cross-spawn": "^7.0.6",
|
102
|
-
"debug": "^4.4.
|
102
|
+
"debug": "^4.4.3",
|
103
103
|
"dep-types": "link:./src/types",
|
104
104
|
"dotenv": "^17.2.2",
|
105
105
|
"dotenv-expand": "^12.0.3",
|
@@ -111,7 +111,7 @@
|
|
111
111
|
"http-proxy-3": "^1.21.0",
|
112
112
|
"launch-editor-middleware": "^2.11.1",
|
113
113
|
"lightningcss": "^1.30.1",
|
114
|
-
"magic-string": "^0.30.
|
114
|
+
"magic-string": "^0.30.19",
|
115
115
|
"mlly": "^1.8.0",
|
116
116
|
"mrmime": "^2.0.1",
|
117
117
|
"nanoid": "^5.1.5",
|
@@ -125,8 +125,8 @@
|
|
125
125
|
"postcss-modules": "^6.0.1",
|
126
126
|
"premove": "^4.0.0",
|
127
127
|
"resolve.exports": "^2.0.3",
|
128
|
-
"rolldown": "^1.0.0-beta.
|
129
|
-
"rolldown-plugin-dts": "^0.
|
128
|
+
"rolldown": "^1.0.0-beta.37",
|
129
|
+
"rolldown-plugin-dts": "^0.16.5",
|
130
130
|
"rollup-plugin-license": "^3.6.0",
|
131
131
|
"sass": "^1.92.1",
|
132
132
|
"sass-embedded": "^1.92.1",
|
package/types/importMeta.d.ts
CHANGED
@@ -11,8 +11,7 @@ interface ViteTypeOptions {
|
|
11
11
|
type ImportMetaEnvFallbackKey =
|
12
12
|
'strictImportMetaEnv' extends keyof ViteTypeOptions ? never : string
|
13
13
|
|
14
|
-
interface ImportMetaEnv {
|
15
|
-
[key: ImportMetaEnvFallbackKey]: any
|
14
|
+
interface ImportMetaEnv extends Record<ImportMetaEnvFallbackKey, any> {
|
16
15
|
BASE_URL: string
|
17
16
|
MODE: string
|
18
17
|
DEV: boolean
|