vite 7.0.0-beta.0 → 7.0.0-beta.1
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/bin/vite.js +4 -4
- package/dist/client/client.mjs +14 -14
- package/dist/node/chunks/{dep-Ccq9jQdz.js → dep-3PhSlasG.js} +1 -1
- package/dist/node/chunks/{dep-RiwDEHuV.js → dep-BO5GbxpL.js} +3 -3
- package/dist/node/chunks/{dep-D_UgUiRQ.js → dep-BaSfMtGz.js} +1 -1
- package/dist/node/chunks/{dep-P8c3Tybu.js → dep-Bb92EWrU.js} +1 -1
- package/dist/node/chunks/{dep-3jlWaCfC.js → dep-C9KS6hrN.js} +1 -1
- package/dist/node/chunks/{dep-bvBD1i2C.js → dep-Da5Rc_CS.js} +656 -625
- package/dist/node/chunks/{dep-CCzsqxOh.js → dep-Dg4W3IAQ.js} +49 -49
- package/dist/node/chunks/{dep-FHYvcJhE.js → dep-uSUFJk9A.js} +20 -20
- package/dist/node/cli.js +6 -6
- package/dist/node/index.d.ts +9 -58
- package/dist/node/index.js +1 -1
- package/dist/node/module-runner.d.ts +9 -12
- package/dist/node/module-runner.js +27 -22
- package/dist/node/{moduleRunnerTransport-CnL9s_k9.d.ts → moduleRunnerTransport-BWUZBVLX.d.ts} +2 -2
- package/package.json +8 -9
- package/types/importGlob.d.ts +4 -0
- package/types/internal/cssPreprocessorOptions.d.ts +3 -3
@@ -129,23 +129,23 @@ const ERR_OUTDATED_OPTIMIZED_DEP = "ERR_OUTDATED_OPTIMIZED_DEP";
|
|
129
129
|
|
130
130
|
//#endregion
|
131
131
|
//#region src/shared/utils.ts
|
132
|
-
const isWindows
|
132
|
+
const isWindows = typeof process !== "undefined" && process.platform === "win32";
|
133
133
|
/**
|
134
134
|
* Prepend `/@id/` and replace null byte so the id is URL-safe.
|
135
135
|
* This is prepended to resolved ids that are not valid browser
|
136
136
|
* import specifiers by the importAnalysis plugin.
|
137
137
|
*/
|
138
|
-
function wrapId
|
138
|
+
function wrapId(id) {
|
139
139
|
return id.startsWith(VALID_ID_PREFIX) ? id : VALID_ID_PREFIX + id.replace("\0", NULL_BYTE_PLACEHOLDER);
|
140
140
|
}
|
141
141
|
/**
|
142
142
|
* Undo {@link wrapId}'s `/@id/` and null byte replacements.
|
143
143
|
*/
|
144
|
-
function unwrapId
|
144
|
+
function unwrapId(id) {
|
145
145
|
return id.startsWith(VALID_ID_PREFIX) ? id.slice(VALID_ID_PREFIX.length).replace(NULL_BYTE_PLACEHOLDER, "\0") : id;
|
146
146
|
}
|
147
147
|
const windowsSlashRE = /\\/g;
|
148
|
-
function slash
|
148
|
+
function slash(p$1) {
|
149
149
|
return p$1.replace(windowsSlashRE, "/");
|
150
150
|
}
|
151
151
|
const postfixRE = /[?#].*$/;
|
@@ -475,7 +475,7 @@ function normalizePath$4(url$6, type) {
|
|
475
475
|
/**
|
476
476
|
* Attempts to resolve `input` URL/path relative to `base`.
|
477
477
|
*/
|
478
|
-
function resolve$
|
478
|
+
function resolve$3(input, base) {
|
479
479
|
if (!input && !base) return "";
|
480
480
|
const url$6 = parseUrl$3(input);
|
481
481
|
let inputType = url$6.type;
|
@@ -513,9 +513,9 @@ function resolve$4(input, base) {
|
|
513
513
|
|
514
514
|
//#endregion
|
515
515
|
//#region ../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
|
516
|
-
function resolve$
|
516
|
+
function resolve$4(input, base) {
|
517
517
|
if (base && !base.endsWith("/")) base += "/";
|
518
|
-
return resolve$
|
518
|
+
return resolve$3(input, base);
|
519
519
|
}
|
520
520
|
/**
|
521
521
|
* Removes everything after the last "/", but leaves the slash.
|
@@ -635,8 +635,8 @@ var TraceMap = class {
|
|
635
635
|
this.sources = sources;
|
636
636
|
this.sourcesContent = sourcesContent;
|
637
637
|
this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;
|
638
|
-
const from = resolve$
|
639
|
-
this.resolvedSources = sources.map((s$2) => resolve$
|
638
|
+
const from = resolve$4(sourceRoot || "", stripFilename(mapUrl));
|
639
|
+
this.resolvedSources = sources.map((s$2) => resolve$4(s$2 || "", from));
|
640
640
|
const { mappings } = parsed;
|
641
641
|
if (typeof mappings === "string") {
|
642
642
|
this._encoded = mappings;
|
@@ -688,7 +688,7 @@ function traceSegment(map$1, line, column) {
|
|
688
688
|
* (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in
|
689
689
|
* `source-map` library.
|
690
690
|
*/
|
691
|
-
function originalPositionFor
|
691
|
+
function originalPositionFor(map$1, needle) {
|
692
692
|
let { line, column, bias } = needle;
|
693
693
|
line--;
|
694
694
|
if (line < 0) throw new Error(LINE_GTR_ZERO);
|
@@ -992,7 +992,7 @@ function traceMappings(tree) {
|
|
992
992
|
let traced = SOURCELESS_MAPPING;
|
993
993
|
if (segment.length !== 1) {
|
994
994
|
const source$1 = rootSources[segment[1]];
|
995
|
-
traced = originalPositionFor(source$1, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : "");
|
995
|
+
traced = originalPositionFor$1(source$1, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : "");
|
996
996
|
if (traced == null) continue;
|
997
997
|
}
|
998
998
|
const { column, line, name, content, source, ignore } = traced;
|
@@ -1007,12 +1007,12 @@ function traceMappings(tree) {
|
|
1007
1007
|
* originalPositionFor is only called on children SourceMapTrees. It recurses down into its own
|
1008
1008
|
* child SourceMapTrees, until we find the original source map.
|
1009
1009
|
*/
|
1010
|
-
function originalPositionFor(source, line, column, name) {
|
1010
|
+
function originalPositionFor$1(source, line, column, name) {
|
1011
1011
|
if (!source.map) return SegmentObject(source.source, line, column, name, source.content, source.ignore);
|
1012
1012
|
const segment = traceSegment(source.map, line, column);
|
1013
1013
|
if (segment == null) return null;
|
1014
1014
|
if (segment.length === 1) return SOURCELESS_MAPPING;
|
1015
|
-
return originalPositionFor(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name);
|
1015
|
+
return originalPositionFor$1(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name);
|
1016
1016
|
}
|
1017
1017
|
function asArray(value$1) {
|
1018
1018
|
if (Array.isArray(value$1)) return value$1;
|
@@ -1281,7 +1281,7 @@ var require_common$1 = __commonJS({ "../../node_modules/.pnpm/debug@4.4.1/node_m
|
|
1281
1281
|
function debug$19(...args) {
|
1282
1282
|
if (!debug$19.enabled) return;
|
1283
1283
|
const self$1 = debug$19;
|
1284
|
-
const curr = Number(new Date());
|
1284
|
+
const curr = Number(/* @__PURE__ */ new Date());
|
1285
1285
|
const ms = curr - (prevTime$1 || curr);
|
1286
1286
|
self$1.diff = ms;
|
1287
1287
|
self$1.prev = prevTime$1;
|
@@ -1578,7 +1578,7 @@ var require_node$1 = __commonJS({ "../../node_modules/.pnpm/debug@4.4.1/node_mod
|
|
1578
1578
|
}
|
1579
1579
|
function getDate() {
|
1580
1580
|
if (exports.inspectOpts.hideDate) return "";
|
1581
|
-
return new Date().toISOString() + " ";
|
1581
|
+
return (/* @__PURE__ */ new Date()).toISOString() + " ";
|
1582
1582
|
}
|
1583
1583
|
/**
|
1584
1584
|
* Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
|
@@ -2029,7 +2029,7 @@ if (process.versions.pnp) try {
|
|
2029
2029
|
)("pnpapi");
|
2030
2030
|
} catch {}
|
2031
2031
|
function invalidatePackageData(packageCache, pkgPath) {
|
2032
|
-
const pkgDir = normalizePath
|
2032
|
+
const pkgDir = normalizePath(path.dirname(pkgPath));
|
2033
2033
|
packageCache.forEach((pkg, cacheKey) => {
|
2034
2034
|
if (pkg.dir === pkgDir) packageCache.delete(cacheKey);
|
2035
2035
|
});
|
@@ -2094,7 +2094,7 @@ function findNearestMainPackageData(basedir, packageCache) {
|
|
2094
2094
|
}
|
2095
2095
|
function loadPackageData(pkgPath) {
|
2096
2096
|
const data = JSON.parse(stripBomTag(fs.readFileSync(pkgPath, "utf-8")));
|
2097
|
-
const pkgDir = normalizePath
|
2097
|
+
const pkgDir = normalizePath(path.dirname(pkgPath));
|
2098
2098
|
const { sideEffects } = data;
|
2099
2099
|
let hasSideEffects;
|
2100
2100
|
if (typeof sideEffects === "boolean") hasSideEffects = () => sideEffects;
|
@@ -2104,7 +2104,7 @@ function loadPackageData(pkgPath) {
|
|
2104
2104
|
if (sideEffect.includes("/")) return sideEffect;
|
2105
2105
|
return `**/${sideEffect}`;
|
2106
2106
|
});
|
2107
|
-
hasSideEffects = createFilter
|
2107
|
+
hasSideEffects = createFilter(finalPackageSideEffects, null, { resolve: pkgDir });
|
2108
2108
|
}
|
2109
2109
|
else hasSideEffects = () => null;
|
2110
2110
|
const resolvedCache = {};
|
@@ -2141,15 +2141,15 @@ function findNearestNodeModules(basedir) {
|
|
2141
2141
|
return null;
|
2142
2142
|
}
|
2143
2143
|
function watchPackageDataPlugin(packageCache) {
|
2144
|
-
const watchQueue = new Set();
|
2145
|
-
const watchedDirs = new Set();
|
2144
|
+
const watchQueue = /* @__PURE__ */ new Set();
|
2145
|
+
const watchedDirs = /* @__PURE__ */ new Set();
|
2146
2146
|
const watchFileStub = (id) => {
|
2147
2147
|
watchQueue.add(id);
|
2148
2148
|
};
|
2149
2149
|
let watchFile = watchFileStub;
|
2150
2150
|
const setPackageData = packageCache.set.bind(packageCache);
|
2151
2151
|
packageCache.set = (id, pkg) => {
|
2152
|
-
if (!isInNodeModules
|
2152
|
+
if (!isInNodeModules(pkg.dir) && !watchedDirs.has(pkg.dir)) {
|
2153
2153
|
watchedDirs.add(pkg.dir);
|
2154
2154
|
watchFile(path.join(pkg.dir, "package.json"));
|
2155
2155
|
}
|
@@ -2236,9 +2236,9 @@ function traverseBetweenDirs(longerDir, shorterDir, cb) {
|
|
2236
2236
|
|
2237
2237
|
//#endregion
|
2238
2238
|
//#region src/node/utils.ts
|
2239
|
-
var import_picocolors$33 = __toESM(require_picocolors()
|
2240
|
-
var import_node = __toESM(require_node$1()
|
2241
|
-
const createFilter
|
2239
|
+
var import_picocolors$33 = __toESM(require_picocolors());
|
2240
|
+
var import_node = __toESM(require_node$1());
|
2241
|
+
const createFilter = createFilter$2;
|
2242
2242
|
const replaceSlashOrColonRE = /[/:]/g;
|
2243
2243
|
const replaceDotRE = /\./g;
|
2244
2244
|
const replaceNestedIdRE = /\s*>\s*/g;
|
@@ -2258,7 +2258,7 @@ const NODE_BUILTIN_NAMESPACE = "node:";
|
|
2258
2258
|
const NPM_BUILTIN_NAMESPACE = "npm:";
|
2259
2259
|
const BUN_BUILTIN_NAMESPACE = "bun:";
|
2260
2260
|
const nodeBuiltins = builtinModules.filter((id) => !id.includes(":"));
|
2261
|
-
const isBuiltinCache = new WeakMap();
|
2261
|
+
const isBuiltinCache = /* @__PURE__ */ new WeakMap();
|
2262
2262
|
function isBuiltin(builtins$1, id) {
|
2263
2263
|
let isBuiltin$1 = isBuiltinCache.get(builtins$1);
|
2264
2264
|
if (!isBuiltin$1) {
|
@@ -2285,7 +2285,7 @@ function isNodeBuiltin(id) {
|
|
2285
2285
|
if (id.startsWith(NODE_BUILTIN_NAMESPACE)) return true;
|
2286
2286
|
return nodeBuiltins.includes(id);
|
2287
2287
|
}
|
2288
|
-
function isInNodeModules
|
2288
|
+
function isInNodeModules(id) {
|
2289
2289
|
return id.includes("node_modules");
|
2290
2290
|
}
|
2291
2291
|
function moduleListContains(moduleList, id) {
|
@@ -2328,11 +2328,11 @@ function testCaseInsensitiveFS() {
|
|
2328
2328
|
}
|
2329
2329
|
const isCaseInsensitiveFS = testCaseInsensitiveFS();
|
2330
2330
|
const VOLUME_RE = /^[A-Z]:/i;
|
2331
|
-
function normalizePath
|
2332
|
-
return path.posix.normalize(isWindows
|
2331
|
+
function normalizePath(id) {
|
2332
|
+
return path.posix.normalize(isWindows ? slash(id) : id);
|
2333
2333
|
}
|
2334
2334
|
function fsPathFromId(id) {
|
2335
|
-
const fsPath = normalizePath
|
2335
|
+
const fsPath = normalizePath(id.startsWith(FS_PREFIX) ? id.slice(FS_PREFIX.length) : id);
|
2336
2336
|
return fsPath[0] === "/" || VOLUME_RE.test(fsPath) ? fsPath : `/${fsPath}`;
|
2337
2337
|
}
|
2338
2338
|
function fsPathFromUrl(url$6) {
|
@@ -2395,14 +2395,14 @@ function removeImportQuery(url$6) {
|
|
2395
2395
|
function removeDirectQuery(url$6) {
|
2396
2396
|
return url$6.replace(directRequestRE$1, "$1").replace(trailingSeparatorRE, "");
|
2397
2397
|
}
|
2398
|
-
const urlRE
|
2399
|
-
const rawRE
|
2398
|
+
const urlRE = /(\?|&)url(?:&|$)/;
|
2399
|
+
const rawRE = /(\?|&)raw(?:&|$)/;
|
2400
2400
|
function removeUrlQuery(url$6) {
|
2401
|
-
return url$6.replace(urlRE
|
2401
|
+
return url$6.replace(urlRE, "$1").replace(trailingSeparatorRE, "");
|
2402
2402
|
}
|
2403
2403
|
function injectQuery(url$6, queryToInject) {
|
2404
2404
|
const { file, postfix } = splitFileAndPostfix(url$6);
|
2405
|
-
const normalizedFile = isWindows
|
2405
|
+
const normalizedFile = isWindows ? slash(file) : file;
|
2406
2406
|
return `${normalizedFile}?${queryToInject}${postfix[0] === "?" ? `&${postfix.slice(1)}` : postfix}`;
|
2407
2407
|
}
|
2408
2408
|
const timestampRE = /\bt=\d{13}&?\b/;
|
@@ -2439,7 +2439,7 @@ function prettifyUrl(url$6, root) {
|
|
2439
2439
|
return import_picocolors$33.default.dim(file);
|
2440
2440
|
} else return import_picocolors$33.default.dim(url$6);
|
2441
2441
|
}
|
2442
|
-
function isObject
|
2442
|
+
function isObject(value$1) {
|
2443
2443
|
return Object.prototype.toString.call(value$1) === "[object Object]";
|
2444
2444
|
}
|
2445
2445
|
function isDefined(value$1) {
|
@@ -2557,7 +2557,7 @@ function emptyDir(dir, skip) {
|
|
2557
2557
|
if (skip?.length) for (const file of skip) if (path.dirname(file) !== ".") {
|
2558
2558
|
const matched = splitFirstDirRE.exec(file);
|
2559
2559
|
if (matched) {
|
2560
|
-
nested ??= new Map();
|
2560
|
+
nested ??= /* @__PURE__ */ new Map();
|
2561
2561
|
const [, nestedDir, skipPath] = matched;
|
2562
2562
|
let nestedSkip = nested.get(nestedDir);
|
2563
2563
|
if (!nestedSkip) {
|
@@ -2604,12 +2604,12 @@ async function recursiveReaddir(dir) {
|
|
2604
2604
|
}
|
2605
2605
|
const files = await Promise.all(dirents.map((dirent) => {
|
2606
2606
|
const res = path.resolve(dir, dirent.name);
|
2607
|
-
return dirent.isDirectory() ? recursiveReaddir(res) : normalizePath
|
2607
|
+
return dirent.isDirectory() ? recursiveReaddir(res) : normalizePath(res);
|
2608
2608
|
}));
|
2609
2609
|
return files.flat(1);
|
2610
2610
|
}
|
2611
|
-
let safeRealpathSync = isWindows
|
2612
|
-
const windowsNetworkMap = new Map();
|
2611
|
+
let safeRealpathSync = isWindows ? windowsSafeRealPathSync : fs.realpathSync.native;
|
2612
|
+
const windowsNetworkMap = /* @__PURE__ */ new Map();
|
2613
2613
|
function windowsMappedRealpathSync(path$13) {
|
2614
2614
|
const realPath = fs.realpathSync.native(path$13);
|
2615
2615
|
if (realPath.startsWith("\\\\")) {
|
@@ -2865,7 +2865,7 @@ function backwardCompatibleWorkerPlugins(plugins$1) {
|
|
2865
2865
|
}
|
2866
2866
|
function deepClone(value$1) {
|
2867
2867
|
if (Array.isArray(value$1)) return value$1.map((v) => deepClone(v));
|
2868
|
-
if (isObject
|
2868
|
+
if (isObject(value$1)) {
|
2869
2869
|
const cloned = {};
|
2870
2870
|
for (const key in value$1) cloned[key] = deepClone(value$1[key]);
|
2871
2871
|
return cloned;
|
@@ -2885,7 +2885,7 @@ function mergeWithDefaultsRecursively(defaults, values) {
|
|
2885
2885
|
merged[key] = value$1;
|
2886
2886
|
continue;
|
2887
2887
|
}
|
2888
|
-
if (isObject
|
2888
|
+
if (isObject(existing) && isObject(value$1)) {
|
2889
2889
|
merged[key] = mergeWithDefaultsRecursively(existing, value$1);
|
2890
2890
|
continue;
|
2891
2891
|
}
|
@@ -2928,7 +2928,7 @@ function mergeConfigRecursively(defaults, overrides, rootPath) {
|
|
2928
2928
|
merged[key] = [...arraify(existing), ...arraify(value$1)];
|
2929
2929
|
continue;
|
2930
2930
|
}
|
2931
|
-
if (isObject
|
2931
|
+
if (isObject(existing) && isObject(value$1)) {
|
2932
2932
|
merged[key] = mergeConfigRecursively(existing, value$1, rootPath && !environmentPathRE.test(rootPath) ? `${rootPath}.${key}` : key);
|
2933
2933
|
continue;
|
2934
2934
|
}
|
@@ -2943,7 +2943,7 @@ function mergeConfig(defaults, overrides, isRoot = true) {
|
|
2943
2943
|
function mergeAlias(a, b) {
|
2944
2944
|
if (!a) return b;
|
2945
2945
|
if (!b) return a;
|
2946
|
-
if (isObject
|
2946
|
+
if (isObject(a) && isObject(b)) return {
|
2947
2947
|
...a,
|
2948
2948
|
...b
|
2949
2949
|
};
|
@@ -2996,7 +2996,7 @@ const windowsDrivePathPrefixRE = /^[A-Za-z]:[/\\]/;
|
|
2996
2996
|
* this function returns false for them but true for absolute paths (e.g. C:/something)
|
2997
2997
|
*/
|
2998
2998
|
const isNonDriveRelativeAbsolutePath = (p$1) => {
|
2999
|
-
if (!isWindows
|
2999
|
+
if (!isWindows) return p$1[0] === "/";
|
3000
3000
|
return windowsDrivePathPrefixRE.test(p$1);
|
3001
3001
|
};
|
3002
3002
|
/**
|
@@ -3114,7 +3114,7 @@ function partialEncodeURIPath(uri) {
|
|
3114
3114
|
const postfix = filePath !== uri ? uri.slice(filePath.length) : "";
|
3115
3115
|
return filePath.replaceAll("%", "%25") + postfix;
|
3116
3116
|
}
|
3117
|
-
const sigtermCallbacks = new Set();
|
3117
|
+
const sigtermCallbacks = /* @__PURE__ */ new Set();
|
3118
3118
|
const parentSigtermCallback = async (signal, exitCode) => {
|
3119
3119
|
await Promise.all([...sigtermCallbacks].map((cb) => cb(signal, exitCode)));
|
3120
3120
|
};
|
@@ -3139,6 +3139,24 @@ function getServerUrlByHost(resolvedUrls, host) {
|
|
3139
3139
|
}
|
3140
3140
|
return resolvedUrls?.local[0] ?? resolvedUrls?.network[0];
|
3141
3141
|
}
|
3142
|
+
let lastDateNow = 0;
|
3143
|
+
/**
|
3144
|
+
* Similar to `Date.now()`, but strictly monotonically increasing.
|
3145
|
+
*
|
3146
|
+
* This function will never return the same value.
|
3147
|
+
* Thus, the value may differ from the actual time.
|
3148
|
+
*
|
3149
|
+
* related: https://github.com/vitejs/vite/issues/19804
|
3150
|
+
*/
|
3151
|
+
function monotonicDateNow() {
|
3152
|
+
const now = Date.now();
|
3153
|
+
if (now > lastDateNow) {
|
3154
|
+
lastDateNow = now;
|
3155
|
+
return lastDateNow;
|
3156
|
+
}
|
3157
|
+
lastDateNow++;
|
3158
|
+
return lastDateNow;
|
3159
|
+
}
|
3142
3160
|
|
3143
3161
|
//#endregion
|
3144
3162
|
//#region src/node/plugin.ts
|
@@ -3380,7 +3398,7 @@ function getRelativePath(from, to) {
|
|
3380
3398
|
return fromParts.concat(toParts).join("/");
|
3381
3399
|
}
|
3382
3400
|
const toString$1 = Object.prototype.toString;
|
3383
|
-
function isObject$
|
3401
|
+
function isObject$2(thing) {
|
3384
3402
|
return toString$1.call(thing) === "[object Object]";
|
3385
3403
|
}
|
3386
3404
|
function getLocator(source) {
|
@@ -3669,7 +3687,7 @@ var MagicString = class MagicString {
|
|
3669
3687
|
}
|
3670
3688
|
indent(indentStr, options$1) {
|
3671
3689
|
const pattern = /^[^\r\n]/gm;
|
3672
|
-
if (isObject$
|
3690
|
+
if (isObject$2(indentStr)) {
|
3673
3691
|
options$1 = indentStr;
|
3674
3692
|
indentStr = void 0;
|
3675
3693
|
}
|
@@ -4154,8 +4172,8 @@ var require_is_reference = __commonJS({ "../../node_modules/.pnpm/is-reference@1
|
|
4154
4172
|
|
4155
4173
|
//#endregion
|
4156
4174
|
//#region ../../node_modules/.pnpm/@rollup+plugin-commonjs@28.0.3_rollup@4.40.1/node_modules/@rollup/plugin-commonjs/dist/es/index.js
|
4157
|
-
var import_commondir = __toESM(require_commondir());
|
4158
|
-
var import_is_reference = __toESM(require_is_reference());
|
4175
|
+
var import_commondir = __toESM(require_commondir(), 1);
|
4176
|
+
var import_is_reference = __toESM(require_is_reference(), 1);
|
4159
4177
|
var version$1 = "28.0.3";
|
4160
4178
|
var peerDependencies = { rollup: "^2.68.0||^3.0.0||^4.0.0" };
|
4161
4179
|
function tryParse(parse$16, code, id) {
|
@@ -4266,8 +4284,8 @@ function isDirectory$1(path$13) {
|
|
4266
4284
|
return false;
|
4267
4285
|
}
|
4268
4286
|
function getDynamicRequireModules(patterns, dynamicRequireRoot) {
|
4269
|
-
const dynamicRequireModules = new Map();
|
4270
|
-
const dirNames = new Set();
|
4287
|
+
const dynamicRequireModules = /* @__PURE__ */ new Map();
|
4288
|
+
const dirNames = /* @__PURE__ */ new Set();
|
4271
4289
|
for (const pattern of !patterns || Array.isArray(patterns) ? patterns || [] : [patterns]) {
|
4272
4290
|
const isNegated = pattern.startsWith("!");
|
4273
4291
|
const modifyMap = (targetPath, resolvedPath) => isNegated ? dynamicRequireModules.delete(targetPath) : dynamicRequireModules.set(targetPath, resolvedPath);
|
@@ -4394,8 +4412,8 @@ function normalize (path) {
|
|
4394
4412
|
}`;
|
4395
4413
|
}
|
4396
4414
|
const isWrappedId = (id, suffix) => id.endsWith(suffix);
|
4397
|
-
const wrapId = (id, suffix) => `\0${id}${suffix}`;
|
4398
|
-
const unwrapId = (wrappedId, suffix) => wrappedId.slice(1, -suffix.length);
|
4415
|
+
const wrapId$1 = (id, suffix) => `\0${id}${suffix}`;
|
4416
|
+
const unwrapId$1 = (wrappedId, suffix) => wrappedId.slice(1, -suffix.length);
|
4399
4417
|
const PROXY_SUFFIX = "?commonjs-proxy";
|
4400
4418
|
const WRAPPED_SUFFIX = "?commonjs-wrapped";
|
4401
4419
|
const EXTERNAL_SUFFIX = "?commonjs-external";
|
@@ -4508,7 +4526,7 @@ function resolveExtensions(importee, importer, extensions$1) {
|
|
4508
4526
|
return void 0;
|
4509
4527
|
}
|
4510
4528
|
function getResolveId(extensions$1, isPossibleCjsId) {
|
4511
|
-
const currentlyResolving = new Map();
|
4529
|
+
const currentlyResolving = /* @__PURE__ */ new Map();
|
4512
4530
|
return {
|
4513
4531
|
currentlyResolving,
|
4514
4532
|
async resolveId(importee, importer, resolveOptions) {
|
@@ -4523,7 +4541,7 @@ function getResolveId(extensions$1, isPossibleCjsId) {
|
|
4523
4541
|
});
|
4524
4542
|
return null;
|
4525
4543
|
}
|
4526
|
-
if (isWrappedId(importee, WRAPPED_SUFFIX)) return unwrapId(importee, WRAPPED_SUFFIX);
|
4544
|
+
if (isWrappedId(importee, WRAPPED_SUFFIX)) return unwrapId$1(importee, WRAPPED_SUFFIX);
|
4527
4545
|
if (importee.endsWith(ENTRY_SUFFIX) || isWrappedId(importee, MODULE_SUFFIX) || isWrappedId(importee, EXPORTS_SUFFIX) || isWrappedId(importee, PROXY_SUFFIX) || isWrappedId(importee, ES_IMPORT_SUFFIX) || isWrappedId(importee, EXTERNAL_SUFFIX) || importee.startsWith(HELPERS_ID) || importee === DYNAMIC_MODULES_ID) return importee;
|
4528
4546
|
if (importer) {
|
4529
4547
|
if (importer === DYNAMIC_MODULES_ID || isWrappedId(importer, PROXY_SUFFIX) || isWrappedId(importer, ES_IMPORT_SUFFIX) || importer.endsWith(ENTRY_SUFFIX)) return importee;
|
@@ -4548,7 +4566,7 @@ function getResolveId(extensions$1, isPossibleCjsId) {
|
|
4548
4566
|
return resolved.id + ENTRY_SUFFIX;
|
4549
4567
|
}
|
4550
4568
|
if (isCommonJS === IS_WRAPPED_COMMONJS) return {
|
4551
|
-
id: wrapId(resolved.id, ES_IMPORT_SUFFIX),
|
4569
|
+
id: wrapId$1(resolved.id, ES_IMPORT_SUFFIX),
|
4552
4570
|
meta: { commonjs: { resolved } }
|
4553
4571
|
};
|
4554
4572
|
}
|
@@ -4562,7 +4580,7 @@ function getRequireResolver(extensions$1, detectCyclesAndConditional, currentlyR
|
|
4562
4580
|
const requiredIds = Object.create(null);
|
4563
4581
|
const unconditionallyRequiredIds = Object.create(null);
|
4564
4582
|
const dependencies = Object.create(null);
|
4565
|
-
const getDependencies = (id) => dependencies[id] || (dependencies[id] = new Set());
|
4583
|
+
const getDependencies = (id) => dependencies[id] || (dependencies[id] = /* @__PURE__ */ new Set());
|
4566
4584
|
const isCyclic = (id) => {
|
4567
4585
|
const dependenciesToCheck = new Set(getDependencies(id));
|
4568
4586
|
for (const dependency of dependenciesToCheck) {
|
@@ -4621,7 +4639,7 @@ function getRequireResolver(extensions$1, detectCyclesAndConditional, currentlyR
|
|
4621
4639
|
parentMeta.requires = [];
|
4622
4640
|
parentMeta.isRequiredCommonJS = Object.create(null);
|
4623
4641
|
setInitialParentType(parentId, isParentCommonJS);
|
4624
|
-
const currentlyResolvingForParent = currentlyResolving.get(parentId) || new Set();
|
4642
|
+
const currentlyResolvingForParent = currentlyResolving.get(parentId) || /* @__PURE__ */ new Set();
|
4625
4643
|
currentlyResolving.set(parentId, currentlyResolvingForParent);
|
4626
4644
|
const requireTargets = await Promise.all(sources.map(async ({ source, isConditional }) => {
|
4627
4645
|
if (source.startsWith("\0")) return {
|
@@ -4635,12 +4653,12 @@ function getRequireResolver(extensions$1, detectCyclesAndConditional, currentlyR
|
|
4635
4653
|
}) || resolveExtensions(source, parentId, extensions$1);
|
4636
4654
|
currentlyResolvingForParent.delete(source);
|
4637
4655
|
if (!resolved) return {
|
4638
|
-
id: wrapId(source, EXTERNAL_SUFFIX),
|
4656
|
+
id: wrapId$1(source, EXTERNAL_SUFFIX),
|
4639
4657
|
allowProxy: false
|
4640
4658
|
};
|
4641
4659
|
const childId = resolved.id;
|
4642
4660
|
if (resolved.external) return {
|
4643
|
-
id: wrapId(childId, EXTERNAL_SUFFIX),
|
4661
|
+
id: wrapId$1(childId, EXTERNAL_SUFFIX),
|
4644
4662
|
allowProxy: false
|
4645
4663
|
};
|
4646
4664
|
parentMeta.requires.push({
|
@@ -4662,7 +4680,7 @@ function getRequireResolver(extensions$1, detectCyclesAndConditional, currentlyR
|
|
4662
4680
|
return {
|
4663
4681
|
wrappedModuleSideEffects: isWrappedCommonJS && rollupContext.getModuleInfo(dependencyId).moduleSideEffects,
|
4664
4682
|
source: sources[index].source,
|
4665
|
-
id: allowProxy ? wrapId(dependencyId, isWrappedCommonJS ? WRAPPED_SUFFIX : PROXY_SUFFIX) : dependencyId,
|
4683
|
+
id: allowProxy ? wrapId$1(dependencyId, isWrappedCommonJS ? WRAPPED_SUFFIX : PROXY_SUFFIX) : dependencyId,
|
4666
4684
|
isCommonJS
|
4667
4685
|
};
|
4668
4686
|
});
|
@@ -4890,8 +4908,8 @@ function getRequireHandlers() {
|
|
4890
4908
|
const imports = [];
|
4891
4909
|
imports.push(`import * as ${helpersName} from "${HELPERS_ID}"`);
|
4892
4910
|
if (dynamicRequireName) imports.push(`import { ${isDynamicRequireModulesEnabled ? CREATE_COMMONJS_REQUIRE_EXPORT : COMMONJS_REQUIRE_EXPORT} as ${dynamicRequireName} } from "${DYNAMIC_MODULES_ID}"`);
|
4893
|
-
if (exportMode === "module") imports.push(`import { __module as ${moduleName} } from ${JSON.stringify(wrapId(id, MODULE_SUFFIX))}`, `var ${exportsName} = ${moduleName}.exports`);
|
4894
|
-
else if (exportMode === "exports") imports.push(`import { __exports as ${exportsName} } from ${JSON.stringify(wrapId(id, EXPORTS_SUFFIX))}`);
|
4911
|
+
if (exportMode === "module") imports.push(`import { __module as ${moduleName} } from ${JSON.stringify(wrapId$1(id, MODULE_SUFFIX))}`, `var ${exportsName} = ${moduleName}.exports`);
|
4912
|
+
else if (exportMode === "exports") imports.push(`import { __exports as ${exportsName} } from ${JSON.stringify(wrapId$1(id, EXPORTS_SUFFIX))}`);
|
4895
4913
|
const requiresBySource = collectSources(requireExpressions);
|
4896
4914
|
const requireTargets = await resolveRequireSourcesAndUpdateMeta(id, needsRequireWrapper ? IS_WRAPPED_COMMONJS : !isEsModule, commonjsMeta, Object.keys(requiresBySource).map((source) => {
|
4897
4915
|
return {
|
@@ -4974,24 +4992,24 @@ async function transformCommonjs(parse$16, code, id, isEsModule, ignoreGlobal, i
|
|
4974
4992
|
let classBodyDepth = 0;
|
4975
4993
|
let currentTryBlockEnd = null;
|
4976
4994
|
let shouldWrap = false;
|
4977
|
-
const globals = new Set();
|
4995
|
+
const globals = /* @__PURE__ */ new Set();
|
4978
4996
|
let currentConditionalNodeEnd = null;
|
4979
|
-
const conditionalNodes = new Set();
|
4997
|
+
const conditionalNodes = /* @__PURE__ */ new Set();
|
4980
4998
|
const { addRequireExpression, rewriteRequireExpressionsAndGetImportBlock } = getRequireHandlers();
|
4981
|
-
const reassignedNames = new Set();
|
4999
|
+
const reassignedNames = /* @__PURE__ */ new Set();
|
4982
5000
|
const topLevelDeclarations = [];
|
4983
|
-
const skippedNodes = new Set();
|
5001
|
+
const skippedNodes = /* @__PURE__ */ new Set();
|
4984
5002
|
const moduleAccessScopes = new Set([scope]);
|
4985
5003
|
const exportsAccessScopes = new Set([scope]);
|
4986
5004
|
const moduleExportsAssignments = [];
|
4987
5005
|
let firstTopLevelModuleExportsAssignment = null;
|
4988
|
-
const exportsAssignmentsByName = new Map();
|
4989
|
-
const topLevelAssignments = new Set();
|
5006
|
+
const exportsAssignmentsByName = /* @__PURE__ */ new Map();
|
5007
|
+
const topLevelAssignments = /* @__PURE__ */ new Set();
|
4990
5008
|
const topLevelDefineCompiledEsmExpressions = [];
|
4991
5009
|
const replacedGlobal = [];
|
4992
5010
|
const replacedThis = [];
|
4993
5011
|
const replacedDynamicRequires = [];
|
4994
|
-
const importedVariables = new Set();
|
5012
|
+
const importedVariables = /* @__PURE__ */ new Set();
|
4995
5013
|
const indentExclusionRanges = [];
|
4996
5014
|
walk$2(ast, {
|
4997
5015
|
enter(node, parent) {
|
@@ -5030,7 +5048,7 @@ async function transformCommonjs(parse$16, code, id, isEsModule, ignoreGlobal, i
|
|
5030
5048
|
else {
|
5031
5049
|
const exportsAssignments = exportsAssignmentsByName.get(exportName) || {
|
5032
5050
|
nodes: [],
|
5033
|
-
scopes: new Set()
|
5051
|
+
scopes: /* @__PURE__ */ new Set()
|
5034
5052
|
};
|
5035
5053
|
exportsAssignments.nodes.push({
|
5036
5054
|
node,
|
@@ -5334,21 +5352,21 @@ function commonjs(options$1 = {}) {
|
|
5334
5352
|
async load(id) {
|
5335
5353
|
if (id === HELPERS_ID) return getHelpersModule();
|
5336
5354
|
if (isWrappedId(id, MODULE_SUFFIX)) {
|
5337
|
-
const name = getName(unwrapId(id, MODULE_SUFFIX));
|
5355
|
+
const name = getName(unwrapId$1(id, MODULE_SUFFIX));
|
5338
5356
|
return {
|
5339
5357
|
code: `var ${name} = {exports: {}}; export {${name} as __module}`,
|
5340
5358
|
meta: { commonjs: { isCommonJS: false } }
|
5341
5359
|
};
|
5342
5360
|
}
|
5343
5361
|
if (isWrappedId(id, EXPORTS_SUFFIX)) {
|
5344
|
-
const name = getName(unwrapId(id, EXPORTS_SUFFIX));
|
5362
|
+
const name = getName(unwrapId$1(id, EXPORTS_SUFFIX));
|
5345
5363
|
return {
|
5346
5364
|
code: `var ${name} = {}; export {${name} as __exports}`,
|
5347
5365
|
meta: { commonjs: { isCommonJS: false } }
|
5348
5366
|
};
|
5349
5367
|
}
|
5350
5368
|
if (isWrappedId(id, EXTERNAL_SUFFIX)) {
|
5351
|
-
const actualId = unwrapId(id, EXTERNAL_SUFFIX);
|
5369
|
+
const actualId = unwrapId$1(id, EXTERNAL_SUFFIX);
|
5352
5370
|
return getUnknownRequireProxy(actualId, isEsmExternal(actualId) ? getRequireReturnsDefault(actualId) : true);
|
5353
5371
|
}
|
5354
5372
|
if (id.endsWith(ENTRY_SUFFIX)) {
|
@@ -5358,12 +5376,12 @@ function commonjs(options$1 = {}) {
|
|
5358
5376
|
return getEntryProxy(acutalId, getDefaultIsModuleExports(acutalId), this.getModuleInfo, shebang);
|
5359
5377
|
}
|
5360
5378
|
if (isWrappedId(id, ES_IMPORT_SUFFIX)) {
|
5361
|
-
const actualId = unwrapId(id, ES_IMPORT_SUFFIX);
|
5379
|
+
const actualId = unwrapId$1(id, ES_IMPORT_SUFFIX);
|
5362
5380
|
return getEsImportProxy(actualId, getDefaultIsModuleExports(actualId), (await this.load({ id: actualId })).moduleSideEffects);
|
5363
5381
|
}
|
5364
5382
|
if (id === DYNAMIC_MODULES_ID) return getDynamicModuleRegistry(isDynamicRequireModulesEnabled, dynamicRequireModules, commonDir, ignoreDynamicRequires);
|
5365
5383
|
if (isWrappedId(id, PROXY_SUFFIX)) {
|
5366
|
-
const actualId = unwrapId(id, PROXY_SUFFIX);
|
5384
|
+
const actualId = unwrapId$1(id, PROXY_SUFFIX);
|
5367
5385
|
return getStaticRequireProxy(actualId, getRequireReturnsDefault(actualId), this.load);
|
5368
5386
|
}
|
5369
5387
|
return null;
|
@@ -5392,7 +5410,7 @@ function commonjs(options$1 = {}) {
|
|
5392
5410
|
* @experimental
|
5393
5411
|
*/
|
5394
5412
|
function perEnvironmentState(initial) {
|
5395
|
-
const stateMap = new WeakMap();
|
5413
|
+
const stateMap = /* @__PURE__ */ new WeakMap();
|
5396
5414
|
return function(context) {
|
5397
5415
|
const { environment } = context;
|
5398
5416
|
let state = stateMap.get(environment);
|
@@ -5406,7 +5424,7 @@ function perEnvironmentState(initial) {
|
|
5406
5424
|
|
5407
5425
|
//#endregion
|
5408
5426
|
//#region src/node/logger.ts
|
5409
|
-
var import_picocolors$32 = __toESM(require_picocolors()
|
5427
|
+
var import_picocolors$32 = __toESM(require_picocolors());
|
5410
5428
|
const LogLevels = {
|
5411
5429
|
silent: 0,
|
5412
5430
|
error: 1,
|
@@ -5434,7 +5452,7 @@ function getTimeFormatter() {
|
|
5434
5452
|
}
|
5435
5453
|
function createLogger(level = "info", options$1 = {}) {
|
5436
5454
|
if (options$1.customLogger) return options$1.customLogger;
|
5437
|
-
const loggedErrors = new WeakSet();
|
5455
|
+
const loggedErrors = /* @__PURE__ */ new WeakSet();
|
5438
5456
|
const { prefix: prefix$1 = "[vite]", allowClearScreen = true, console: console$1 = globalThis.console } = options$1;
|
5439
5457
|
const thresh = LogLevels[level];
|
5440
5458
|
const canClearScreen = allowClearScreen && process.stdout.isTTY && !process.env.CI;
|
@@ -5446,7 +5464,7 @@ function createLogger(level = "info", options$1 = {}) {
|
|
5446
5464
|
else if (type === "warn") tag = import_picocolors$32.default.yellow(import_picocolors$32.default.bold(prefix$1));
|
5447
5465
|
else tag = import_picocolors$32.default.red(import_picocolors$32.default.bold(prefix$1));
|
5448
5466
|
const environment = options$2.environment ? options$2.environment + " " : "";
|
5449
|
-
return `${import_picocolors$32.default.dim(getTimeFormatter().format(new Date()))} ${tag} ${environment}${msg}`;
|
5467
|
+
return `${import_picocolors$32.default.dim(getTimeFormatter().format(/* @__PURE__ */ new Date()))} ${tag} ${environment}${msg}`;
|
5450
5468
|
} else return msg;
|
5451
5469
|
}
|
5452
5470
|
function output(type, msg, options$2 = {}) {
|
@@ -5467,7 +5485,7 @@ function createLogger(level = "info", options$1 = {}) {
|
|
5467
5485
|
else console$1[method](format$3(type, msg, options$2));
|
5468
5486
|
}
|
5469
5487
|
}
|
5470
|
-
const warnedMessages = new Set();
|
5488
|
+
const warnedMessages = /* @__PURE__ */ new Set();
|
5471
5489
|
const logger = {
|
5472
5490
|
hasWarned: false,
|
5473
5491
|
info(msg, opts) {
|
@@ -5505,7 +5523,7 @@ function printServerUrls(urls, optionsHost, info) {
|
|
5505
5523
|
|
5506
5524
|
//#endregion
|
5507
5525
|
//#region src/node/plugins/reporter.ts
|
5508
|
-
var import_picocolors$31 = __toESM(require_picocolors()
|
5526
|
+
var import_picocolors$31 = __toESM(require_picocolors());
|
5509
5527
|
const groups = [
|
5510
5528
|
{
|
5511
5529
|
name: "Assets",
|
@@ -5628,7 +5646,7 @@ function buildReporterPlugin(config$2) {
|
|
5628
5646
|
const sizePad = displaySize(biggestSize).length;
|
5629
5647
|
const mapPad = displaySize(biggestMap).length;
|
5630
5648
|
const compressPad = displaySize(biggestCompressSize).length;
|
5631
|
-
const relativeOutDir = normalizePath
|
5649
|
+
const relativeOutDir = normalizePath(path.relative(config$2.root, path.resolve(config$2.root, outDir ?? environment.config.build.outDir)));
|
5632
5650
|
const assetsDir = path.join(environment.config.build.assetsDir, "/");
|
5633
5651
|
for (const group of groups) {
|
5634
5652
|
const filtered = entries.filter((e$1) => e$1.group === group.name);
|
@@ -5675,7 +5693,7 @@ function buildReporterPlugin(config$2) {
|
|
5675
5693
|
const module$1 = this.getModuleInfo(id);
|
5676
5694
|
if (!module$1) continue;
|
5677
5695
|
if (module$1.importers.length && module$1.dynamicImporters.length) {
|
5678
|
-
const detectedIneffectiveDynamicImport = module$1.dynamicImporters.some((id$1) => !isInNodeModules
|
5696
|
+
const detectedIneffectiveDynamicImport = module$1.dynamicImporters.some((id$1) => !isInNodeModules(id$1) && chunk.moduleIds.includes(id$1));
|
5679
5697
|
if (detectedIneffectiveDynamicImport) this.warn(`\n(!) ${module$1.id} is dynamically imported by ${module$1.dynamicImporters.join(", ")} but also statically imported by ${module$1.importers.join(", ")}, dynamic import will not move module into another chunk.\n`);
|
5680
5698
|
}
|
5681
5699
|
}
|
@@ -5714,7 +5732,7 @@ function throttle(fn) {
|
|
5714
5732
|
const POSIX_SEP_RE = new RegExp("\\" + path.posix.sep, "g");
|
5715
5733
|
const NATIVE_SEP_RE = new RegExp("\\" + path.sep, "g");
|
5716
5734
|
/** @type {Map<string,RegExp>}*/
|
5717
|
-
const PATTERN_REGEX_CACHE = new Map();
|
5735
|
+
const PATTERN_REGEX_CACHE = /* @__PURE__ */ new Map();
|
5718
5736
|
const GLOB_ALL_PATTERN = `**/*`;
|
5719
5737
|
const TS_EXTENSIONS = [
|
5720
5738
|
".ts",
|
@@ -5767,7 +5785,7 @@ async function resolveTSConfigJson(filename, cache$1) {
|
|
5767
5785
|
* @param {string} dir an absolute directory path
|
5768
5786
|
* @returns {boolean} if dir path includes a node_modules segment
|
5769
5787
|
*/
|
5770
|
-
const isInNodeModules = IS_POSIX ? (dir) => dir.includes("/node_modules/") : (dir) => dir.match(/[/\\]node_modules[/\\]/);
|
5788
|
+
const isInNodeModules$1 = IS_POSIX ? (dir) => dir.includes("/node_modules/") : (dir) => dir.match(/[/\\]node_modules[/\\]/);
|
5771
5789
|
/**
|
5772
5790
|
* convert posix separator to native separator
|
5773
5791
|
*
|
@@ -5952,7 +5970,7 @@ function replaceTokens(result) {
|
|
5952
5970
|
*/
|
5953
5971
|
async function find(filename, options$1) {
|
5954
5972
|
let dir = path.dirname(path.resolve(filename));
|
5955
|
-
if (options$1?.ignoreNodeModules && isInNodeModules(dir)) return null;
|
5973
|
+
if (options$1?.ignoreNodeModules && isInNodeModules$1(dir)) return null;
|
5956
5974
|
const cache$1 = options$1?.cache;
|
5957
5975
|
const configName = options$1?.configName ?? "tsconfig.json";
|
5958
5976
|
if (cache$1?.hasConfigPath(dir, configName)) return cache$1.getConfigPath(dir, configName);
|
@@ -6539,19 +6557,19 @@ var TSConfckCache = class {
|
|
6539
6557
|
* @private
|
6540
6558
|
* @type{Map<string,(Promise<string|null>|string|null)>}
|
6541
6559
|
*/
|
6542
|
-
#configPaths = new Map();
|
6560
|
+
#configPaths = /* @__PURE__ */ new Map();
|
6543
6561
|
/**
|
6544
6562
|
* map files to their parsed tsconfig result
|
6545
6563
|
* @internal
|
6546
6564
|
* @private
|
6547
6565
|
* @type {Map<string,(Promise<T>|T)> }
|
6548
6566
|
*/
|
6549
|
-
#parsed = new Map();
|
6567
|
+
#parsed = /* @__PURE__ */ new Map();
|
6550
6568
|
};
|
6551
6569
|
|
6552
6570
|
//#endregion
|
6553
6571
|
//#region src/node/plugins/esbuild.ts
|
6554
|
-
var import_picocolors$30 = __toESM(require_picocolors()
|
6572
|
+
var import_picocolors$30 = __toESM(require_picocolors());
|
6555
6573
|
const debug$17 = createDebugger("vite:esbuild");
|
6556
6574
|
const IIFE_BEGIN_RE = /(?:const|var)\s+\S+\s*=\s*function\([^()]*\)\s*\{\s*"use strict";/;
|
6557
6575
|
const validExtensionRE = /\.\w+$/;
|
@@ -6649,7 +6667,7 @@ async function transformWithEsbuild(code, filename, options$1, inMap, config$2,
|
|
6649
6667
|
function esbuildPlugin(config$2) {
|
6650
6668
|
const options$1 = config$2.esbuild;
|
6651
6669
|
const { jsxInject, include, exclude,...esbuildTransformOptions } = options$1;
|
6652
|
-
const filter$1 = createFilter
|
6670
|
+
const filter$1 = createFilter(include || /\.(m?ts|[jt]sx)$/, exclude || /\.js$/);
|
6653
6671
|
const transformOptions = {
|
6654
6672
|
target: "esnext",
|
6655
6673
|
charset: "utf8",
|
@@ -6776,7 +6794,7 @@ function prettifyMessage(m$2, code) {
|
|
6776
6794
|
return res + `\n`;
|
6777
6795
|
}
|
6778
6796
|
let globalTSConfckCache;
|
6779
|
-
const tsconfckCacheMap = new WeakMap();
|
6797
|
+
const tsconfckCacheMap = /* @__PURE__ */ new WeakMap();
|
6780
6798
|
function getTSConfckCache(config$2) {
|
6781
6799
|
if (!config$2) return globalTSConfckCache ??= new TSConfckCache();
|
6782
6800
|
let cache$1 = tsconfckCacheMap.get(config$2);
|
@@ -7641,7 +7659,7 @@ function lookup(extn) {
|
|
7641
7659
|
|
7642
7660
|
//#endregion
|
7643
7661
|
//#region src/node/publicDir.ts
|
7644
|
-
const publicFilesMap = new WeakMap();
|
7662
|
+
const publicFilesMap = /* @__PURE__ */ new WeakMap();
|
7645
7663
|
async function initPublicFiles(config$2) {
|
7646
7664
|
let fileNames;
|
7647
7665
|
try {
|
@@ -7662,23 +7680,23 @@ function checkPublicFile(url$6, config$2) {
|
|
7662
7680
|
if (!publicDir || url$6[0] !== "/") return;
|
7663
7681
|
const fileName = cleanUrl(url$6);
|
7664
7682
|
const publicFiles = getPublicFiles(config$2);
|
7665
|
-
if (publicFiles) return publicFiles.has(fileName) ? normalizePath
|
7666
|
-
const publicFile = normalizePath
|
7683
|
+
if (publicFiles) return publicFiles.has(fileName) ? normalizePath(path.join(publicDir, fileName)) : void 0;
|
7684
|
+
const publicFile = normalizePath(path.join(publicDir, fileName));
|
7667
7685
|
if (!publicFile.startsWith(withTrailingSlash(publicDir))) return;
|
7668
7686
|
return fs.existsSync(publicFile) ? publicFile : void 0;
|
7669
7687
|
}
|
7670
7688
|
|
7671
7689
|
//#endregion
|
7672
7690
|
//#region src/node/plugins/asset.ts
|
7673
|
-
var import_picocolors$29 = __toESM(require_picocolors()
|
7691
|
+
var import_picocolors$29 = __toESM(require_picocolors());
|
7674
7692
|
const assetUrlRE = /__VITE_ASSET__([\w$]+)__(?:\$_(.*?)__)?/g;
|
7675
7693
|
const jsSourceMapRE = /\.[cm]?js\.map$/;
|
7676
7694
|
const noInlineRE = /[?&]no-inline\b/;
|
7677
7695
|
const inlineRE$3 = /[?&]inline\b/;
|
7678
7696
|
const svgExtRE = /\.svg(?:$|\?)/;
|
7679
|
-
const assetCache = new WeakMap();
|
7697
|
+
const assetCache = /* @__PURE__ */ new WeakMap();
|
7680
7698
|
/** a set of referenceId for entry CSS assets for each environment */
|
7681
|
-
const cssEntriesMap = new WeakMap();
|
7699
|
+
const cssEntriesMap = /* @__PURE__ */ new WeakMap();
|
7682
7700
|
function registerCustomMime() {
|
7683
7701
|
mimes.ico = "image/x-icon";
|
7684
7702
|
mimes.cur = "image/x-icon";
|
@@ -7722,22 +7740,22 @@ function assetPlugin(config$2) {
|
|
7722
7740
|
name: "vite:asset",
|
7723
7741
|
perEnvironmentStartEndDuringDev: true,
|
7724
7742
|
buildStart() {
|
7725
|
-
assetCache.set(this.environment, new Map());
|
7726
|
-
cssEntriesMap.set(this.environment, new Set());
|
7743
|
+
assetCache.set(this.environment, /* @__PURE__ */ new Map());
|
7744
|
+
cssEntriesMap.set(this.environment, /* @__PURE__ */ new Set());
|
7727
7745
|
},
|
7728
7746
|
resolveId: { handler(id) {
|
7729
|
-
if (!config$2.assetsInclude(cleanUrl(id)) && !urlRE
|
7747
|
+
if (!config$2.assetsInclude(cleanUrl(id)) && !urlRE.test(id)) return;
|
7730
7748
|
const publicFile = checkPublicFile(id, config$2);
|
7731
7749
|
if (publicFile) return id;
|
7732
7750
|
} },
|
7733
7751
|
load: { async handler(id) {
|
7734
7752
|
if (id[0] === "\0") return;
|
7735
|
-
if (rawRE
|
7753
|
+
if (rawRE.test(id)) {
|
7736
7754
|
const file = checkPublicFile(id, config$2) || cleanUrl(id);
|
7737
7755
|
this.addWatchFile(file);
|
7738
7756
|
return `export default ${JSON.stringify(await fsp.readFile(file, "utf-8"))}`;
|
7739
7757
|
}
|
7740
|
-
if (!urlRE
|
7758
|
+
if (!urlRE.test(id) && !config$2.assetsInclude(cleanUrl(id))) return;
|
7741
7759
|
id = removeUrlQuery(id);
|
7742
7760
|
let url$6 = await fileToUrl$1(this, id);
|
7743
7761
|
if (!url$6.startsWith("data:") && this.environment.mode === "dev") {
|
@@ -7764,7 +7782,7 @@ function assetPlugin(config$2) {
|
|
7764
7782
|
const chunk = bundle[file];
|
7765
7783
|
if (chunk.type === "chunk" && chunk.isEntry && chunk.moduleIds.length === 1 && config$2.assetsInclude(chunk.moduleIds[0]) && this.getModuleInfo(chunk.moduleIds[0])?.meta["vite:asset"]) {
|
7766
7784
|
if (!importedFiles) {
|
7767
|
-
importedFiles = new Set();
|
7785
|
+
importedFiles = /* @__PURE__ */ new Set();
|
7768
7786
|
for (const file$1 in bundle) {
|
7769
7787
|
const chunk$1 = bundle[file$1];
|
7770
7788
|
if (chunk$1.type === "chunk") {
|
@@ -7812,14 +7830,14 @@ async function fileToDevUrl(environment, id, skipBase = false) {
|
|
7812
7830
|
function getPublicAssetFilename(hash$1, config$2) {
|
7813
7831
|
return publicAssetUrlCache.get(config$2)?.get(hash$1);
|
7814
7832
|
}
|
7815
|
-
const publicAssetUrlCache = new WeakMap();
|
7833
|
+
const publicAssetUrlCache = /* @__PURE__ */ new WeakMap();
|
7816
7834
|
const publicAssetUrlRE = /__VITE_PUBLIC_ASSET__([a-z\d]{8})__/g;
|
7817
7835
|
function publicFileToBuiltUrl(url$6, config$2) {
|
7818
7836
|
if (config$2.command !== "build") return joinUrlSegments(config$2.decodedBase, url$6);
|
7819
7837
|
const hash$1 = getHash(url$6);
|
7820
7838
|
let cache$1 = publicAssetUrlCache.get(config$2);
|
7821
7839
|
if (!cache$1) {
|
7822
|
-
cache$1 = new Map();
|
7840
|
+
cache$1 = /* @__PURE__ */ new Map();
|
7823
7841
|
publicAssetUrlCache.set(config$2, cache$1);
|
7824
7842
|
}
|
7825
7843
|
if (!cache$1.get(hash$1)) cache$1.set(hash$1, url$6);
|
@@ -7850,7 +7868,7 @@ async function fileToBuiltUrl(pluginContext, id, skipPublicCheck = false, forceI
|
|
7850
7868
|
let url$6;
|
7851
7869
|
if (shouldInline(environment, file, id, content, pluginContext, forceInline)) url$6 = assetToDataURL(environment, file, content);
|
7852
7870
|
else {
|
7853
|
-
const originalFileName = normalizePath
|
7871
|
+
const originalFileName = normalizePath(path.relative(environment.config.root, file));
|
7854
7872
|
const referenceId = pluginContext.emitFile({
|
7855
7873
|
type: "asset",
|
7856
7874
|
name: path.basename(file),
|
@@ -8007,7 +8025,7 @@ function manifestPlugin() {
|
|
8007
8025
|
}
|
8008
8026
|
function getChunkOriginalFileName(chunk, root, format$3) {
|
8009
8027
|
if (chunk.facadeModuleId) {
|
8010
|
-
let name = normalizePath
|
8028
|
+
let name = normalizePath(path.relative(root, chunk.facadeModuleId));
|
8011
8029
|
if (format$3 === "system" && !chunk.name.includes("-legacy")) {
|
8012
8030
|
const ext = path.extname(name);
|
8013
8031
|
const endPos = ext.length !== 0 ? -ext.length : void 0;
|
@@ -8030,7 +8048,7 @@ function dataURIPlugin() {
|
|
8030
8048
|
return {
|
8031
8049
|
name: "vite:data-uri",
|
8032
8050
|
buildStart() {
|
8033
|
-
resolved = new Map();
|
8051
|
+
resolved = /* @__PURE__ */ new Map();
|
8034
8052
|
},
|
8035
8053
|
resolveId(id) {
|
8036
8054
|
if (!id.trimStart().startsWith("data:")) return;
|
@@ -8058,8 +8076,8 @@ var ImportType;
|
|
8058
8076
|
A$1[A$1.Static = 1] = "Static", A$1[A$1.Dynamic = 2] = "Dynamic", A$1[A$1.ImportMeta = 3] = "ImportMeta", A$1[A$1.StaticSourcePhase = 4] = "StaticSourcePhase", A$1[A$1.DynamicSourcePhase = 5] = "DynamicSourcePhase", A$1[A$1.StaticDeferPhase = 6] = "StaticDeferPhase", A$1[A$1.DynamicDeferPhase = 7] = "DynamicDeferPhase";
|
8059
8077
|
})(ImportType || (ImportType = {}));
|
8060
8078
|
const A = 1 === new Uint8Array(new Uint16Array([1]).buffer)[0];
|
8061
|
-
function parse
|
8062
|
-
if (!C) return init
|
8079
|
+
function parse(E$1, g = "@") {
|
8080
|
+
if (!C) return init.then(() => parse(E$1));
|
8063
8081
|
const I = E$1.length + 1, w$1 = (C.__heap_base.value || C.__heap_base) + 4 * I - C.memory.buffer.byteLength;
|
8064
8082
|
w$1 > 0 && C.memory.grow(Math.ceil(w$1 / 65536));
|
8065
8083
|
const K = C.sa(I - 1);
|
@@ -8120,7 +8138,7 @@ const E = () => {
|
|
8120
8138
|
return A$1 = "AGFzbQEAAAABKwhgAX8Bf2AEf39/fwBgAAF/YAAAYAF/AGADf39/AX9gAn9/AX9gA39/fwADMTAAAQECAgICAgICAgICAgICAgICAgIAAwMDBAQAAAUAAAAAAAMDAwAGAAAABwAGAgUEBQFwAQEBBQMBAAEGDwJ/AUHA8gALfwBBwPIACwd6FQZtZW1vcnkCAAJzYQAAAWUAAwJpcwAEAmllAAUCc3MABgJzZQAHAml0AAgCYWkACQJpZAAKAmlwAAsCZXMADAJlZQANA2VscwAOA2VsZQAPAnJpABACcmUAEQFmABICbXMAEwVwYXJzZQAUC19faGVhcF9iYXNlAwEKzkQwaAEBf0EAIAA2AoAKQQAoAtwJIgEgAEEBdGoiAEEAOwEAQQAgAEECaiIANgKECkEAIAA2AogKQQBBADYC4AlBAEEANgLwCUEAQQA2AugJQQBBADYC5AlBAEEANgL4CUEAQQA2AuwJIAEL0wEBA39BACgC8AkhBEEAQQAoAogKIgU2AvAJQQAgBDYC9AlBACAFQSRqNgKICiAEQSBqQeAJIAQbIAU2AgBBACgC1AkhBEEAKALQCSEGIAUgATYCACAFIAA2AgggBSACIAJBAmpBACAGIANGIgAbIAQgA0YiBBs2AgwgBSADNgIUIAVBADYCECAFIAI2AgQgBUEANgIgIAVBA0EBQQIgABsgBBs2AhwgBUEAKALQCSADRiICOgAYAkACQCACDQBBACgC1AkgA0cNAQtBAEEBOgCMCgsLXgEBf0EAKAL4CSIEQRBqQeQJIAQbQQAoAogKIgQ2AgBBACAENgL4CUEAIARBFGo2AogKQQBBAToAjAogBEEANgIQIAQgAzYCDCAEIAI2AgggBCABNgIEIAQgADYCAAsIAEEAKAKQCgsVAEEAKALoCSgCAEEAKALcCWtBAXULHgEBf0EAKALoCSgCBCIAQQAoAtwJa0EBdUF/IAAbCxUAQQAoAugJKAIIQQAoAtwJa0EBdQseAQF/QQAoAugJKAIMIgBBACgC3AlrQQF1QX8gABsLCwBBACgC6AkoAhwLHgEBf0EAKALoCSgCECIAQQAoAtwJa0EBdUF/IAAbCzsBAX8CQEEAKALoCSgCFCIAQQAoAtAJRw0AQX8PCwJAIABBACgC1AlHDQBBfg8LIABBACgC3AlrQQF1CwsAQQAoAugJLQAYCxUAQQAoAuwJKAIAQQAoAtwJa0EBdQsVAEEAKALsCSgCBEEAKALcCWtBAXULHgEBf0EAKALsCSgCCCIAQQAoAtwJa0EBdUF/IAAbCx4BAX9BACgC7AkoAgwiAEEAKALcCWtBAXVBfyAAGwslAQF/QQBBACgC6AkiAEEgakHgCSAAGygCACIANgLoCSAAQQBHCyUBAX9BAEEAKALsCSIAQRBqQeQJIAAbKAIAIgA2AuwJIABBAEcLCABBAC0AlAoLCABBAC0AjAoL3Q0BBX8jAEGA0ABrIgAkAEEAQQE6AJQKQQBBACgC2Ak2ApwKQQBBACgC3AlBfmoiATYCsApBACABQQAoAoAKQQF0aiICNgK0CkEAQQA6AIwKQQBBADsBlgpBAEEAOwGYCkEAQQA6AKAKQQBBADYCkApBAEEAOgD8CUEAIABBgBBqNgKkCkEAIAA2AqgKQQBBADoArAoCQAJAAkACQANAQQAgAUECaiIDNgKwCiABIAJPDQECQCADLwEAIgJBd2pBBUkNAAJAAkACQAJAAkAgAkGbf2oOBQEICAgCAAsgAkEgRg0EIAJBL0YNAyACQTtGDQIMBwtBAC8BmAoNASADEBVFDQEgAUEEakGCCEEKEC8NARAWQQAtAJQKDQFBAEEAKAKwCiIBNgKcCgwHCyADEBVFDQAgAUEEakGMCEEKEC8NABAXC0EAQQAoArAKNgKcCgwBCwJAIAEvAQQiA0EqRg0AIANBL0cNBBAYDAELQQEQGQtBACgCtAohAkEAKAKwCiEBDAALC0EAIQIgAyEBQQAtAPwJDQIMAQtBACABNgKwCkEAQQA6AJQKCwNAQQAgAUECaiIDNgKwCgJAAkACQAJAAkACQAJAIAFBACgCtApPDQAgAy8BACICQXdqQQVJDQYCQAJAAkACQAJAAkACQAJAAkACQCACQWBqDgoQDwYPDw8PBQECAAsCQAJAAkACQCACQaB/ag4KCxISAxIBEhISAgALIAJBhX9qDgMFEQYJC0EALwGYCg0QIAMQFUUNECABQQRqQYIIQQoQLw0QEBYMEAsgAxAVRQ0PIAFBBGpBjAhBChAvDQ8QFwwPCyADEBVFDQ4gASkABELsgISDsI7AOVINDiABLwEMIgNBd2oiAUEXSw0MQQEgAXRBn4CABHFFDQwMDQtBAEEALwGYCiIBQQFqOwGYCkEAKAKkCiABQQN0aiIBQQE2AgAgAUEAKAKcCjYCBAwNC0EALwGYCiIDRQ0JQQAgA0F/aiIDOwGYCkEALwGWCiICRQ0MQQAoAqQKIANB//8DcUEDdGooAgBBBUcNDAJAIAJBAnRBACgCqApqQXxqKAIAIgMoAgQNACADQQAoApwKQQJqNgIEC0EAIAJBf2o7AZYKIAMgAUEEajYCDAwMCwJAQQAoApwKIgEvAQBBKUcNAEEAKALwCSIDRQ0AIAMoAgQgAUcNAEEAQQAoAvQJIgM2AvAJAkAgA0UNACADQQA2AiAMAQtBAEEANgLgCQtBAEEALwGYCiIDQQFqOwGYCkEAKAKkCiADQQN0aiIDQQZBAkEALQCsChs2AgAgAyABNgIEQQBBADoArAoMCwtBAC8BmAoiAUUNB0EAIAFBf2oiATsBmApBACgCpAogAUH//wNxQQN0aigCAEEERg0EDAoLQScQGgwJC0EiEBoMCAsgAkEvRw0HAkACQCABLwEEIgFBKkYNACABQS9HDQEQGAwKC0EBEBkMCQsCQAJAAkACQEEAKAKcCiIBLwEAIgMQG0UNAAJAAkAgA0FVag4EAAkBAwkLIAFBfmovAQBBK0YNAwwICyABQX5qLwEAQS1GDQIMBwsgA0EpRw0BQQAoAqQKQQAvAZgKIgJBA3RqKAIEEBxFDQIMBgsgAUF+ai8BAEFQakH//wNxQQpPDQULQQAvAZgKIQILAkACQCACQf//A3EiAkUNACADQeYARw0AQQAoAqQKIAJBf2pBA3RqIgQoAgBBAUcNACABQX5qLwEAQe8ARw0BIAQoAgRBlghBAxAdRQ0BDAULIANB/QBHDQBBACgCpAogAkEDdGoiAigCBBAeDQQgAigCAEEGRg0ECyABEB8NAyADRQ0DIANBL0ZBAC0AoApBAEdxDQMCQEEAKAL4CSICRQ0AIAEgAigCAEkNACABIAIoAgRNDQQLIAFBfmohAUEAKALcCSECAkADQCABQQJqIgQgAk0NAUEAIAE2ApwKIAEvAQAhAyABQX5qIgQhASADECBFDQALIARBAmohBAsCQCADQf//A3EQIUUNACAEQX5qIQECQANAIAFBAmoiAyACTQ0BQQAgATYCnAogAS8BACEDIAFBfmoiBCEBIAMQIQ0ACyAEQQJqIQMLIAMQIg0EC0EAQQE6AKAKDAcLQQAoAqQKQQAvAZgKIgFBA3QiA2pBACgCnAo2AgRBACABQQFqOwGYCkEAKAKkCiADakEDNgIACxAjDAULQQAtAPwJQQAvAZYKQQAvAZgKcnJFIQIMBwsQJEEAQQA6AKAKDAMLECVBACECDAULIANBoAFHDQELQQBBAToArAoLQQBBACgCsAo2ApwKC0EAKAKwCiEBDAALCyAAQYDQAGokACACCxoAAkBBACgC3AkgAEcNAEEBDwsgAEF+ahAmC/4KAQZ/QQBBACgCsAoiAEEMaiIBNgKwCkEAKAL4CSECQQEQKSEDAkACQAJAAkACQAJAAkACQAJAQQAoArAKIgQgAUcNACADEChFDQELAkACQAJAAkACQAJAAkAgA0EqRg0AIANB+wBHDQFBACAEQQJqNgKwCkEBECkhA0EAKAKwCiEEA0ACQAJAIANB//8DcSIDQSJGDQAgA0EnRg0AIAMQLBpBACgCsAohAwwBCyADEBpBAEEAKAKwCkECaiIDNgKwCgtBARApGgJAIAQgAxAtIgNBLEcNAEEAQQAoArAKQQJqNgKwCkEBECkhAwsgA0H9AEYNA0EAKAKwCiIFIARGDQ8gBSEEIAVBACgCtApNDQAMDwsLQQAgBEECajYCsApBARApGkEAKAKwCiIDIAMQLRoMAgtBAEEAOgCUCgJAAkACQAJAAkACQCADQZ9/ag4MAgsEAQsDCwsLCwsFAAsgA0H2AEYNBAwKC0EAIARBDmoiAzYCsAoCQAJAAkBBARApQZ9/ag4GABICEhIBEgtBACgCsAoiBSkAAkLzgOSD4I3AMVINESAFLwEKECFFDRFBACAFQQpqNgKwCkEAECkaC0EAKAKwCiIFQQJqQbIIQQ4QLw0QIAUvARAiAkF3aiIBQRdLDQ1BASABdEGfgIAEcUUNDQwOC0EAKAKwCiIFKQACQuyAhIOwjsA5Ug0PIAUvAQoiAkF3aiIBQRdNDQYMCgtBACAEQQpqNgKwCkEAECkaQQAoArAKIQQLQQAgBEEQajYCsAoCQEEBECkiBEEqRw0AQQBBACgCsApBAmo2ArAKQQEQKSEEC0EAKAKwCiEDIAQQLBogA0EAKAKwCiIEIAMgBBACQQBBACgCsApBfmo2ArAKDwsCQCAEKQACQuyAhIOwjsA5Ug0AIAQvAQoQIEUNAEEAIARBCmo2ArAKQQEQKSEEQQAoArAKIQMgBBAsGiADQQAoArAKIgQgAyAEEAJBAEEAKAKwCkF+ajYCsAoPC0EAIARBBGoiBDYCsAoLQQAgBEEGajYCsApBAEEAOgCUCkEBECkhBEEAKAKwCiEDIAQQLCEEQQAoArAKIQIgBEHf/wNxIgFB2wBHDQNBACACQQJqNgKwCkEBECkhBUEAKAKwCiEDQQAhBAwEC0EAQQE6AIwKQQBBACgCsApBAmo2ArAKC0EBECkhBEEAKAKwCiEDAkAgBEHmAEcNACADQQJqQawIQQYQLw0AQQAgA0EIajYCsAogAEEBEClBABArIAJBEGpB5AkgAhshAwNAIAMoAgAiA0UNBSADQgA3AgggA0EQaiEDDAALC0EAIANBfmo2ArAKDAMLQQEgAXRBn4CABHFFDQMMBAtBASEECwNAAkACQCAEDgIAAQELIAVB//8DcRAsGkEBIQQMAQsCQAJAQQAoArAKIgQgA0YNACADIAQgAyAEEAJBARApIQQCQCABQdsARw0AIARBIHJB/QBGDQQLQQAoArAKIQMCQCAEQSxHDQBBACADQQJqNgKwCkEBECkhBUEAKAKwCiEDIAVBIHJB+wBHDQILQQAgA0F+ajYCsAoLIAFB2wBHDQJBACACQX5qNgKwCg8LQQAhBAwACwsPCyACQaABRg0AIAJB+wBHDQQLQQAgBUEKajYCsApBARApIgVB+wBGDQMMAgsCQCACQVhqDgMBAwEACyACQaABRw0CC0EAIAVBEGo2ArAKAkBBARApIgVBKkcNAEEAQQAoArAKQQJqNgKwCkEBECkhBQsgBUEoRg0BC0EAKAKwCiEBIAUQLBpBACgCsAoiBSABTQ0AIAQgAyABIAUQAkEAQQAoArAKQX5qNgKwCg8LIAQgA0EAQQAQAkEAIARBDGo2ArAKDwsQJQuFDAEKf0EAQQAoArAKIgBBDGoiATYCsApBARApIQJBACgCsAohAwJAAkACQAJAAkACQAJAAkAgAkEuRw0AQQAgA0ECajYCsAoCQEEBECkiAkHkAEYNAAJAIAJB8wBGDQAgAkHtAEcNB0EAKAKwCiICQQJqQZwIQQYQLw0HAkBBACgCnAoiAxAqDQAgAy8BAEEuRg0ICyAAIAAgAkEIakEAKALUCRABDwtBACgCsAoiAkECakGiCEEKEC8NBgJAQQAoApwKIgMQKg0AIAMvAQBBLkYNBwtBACEEQQAgAkEMajYCsApBASEFQQUhBkEBECkhAkEAIQdBASEIDAILQQAoArAKIgIpAAJC5YCYg9CMgDlSDQUCQEEAKAKcCiIDECoNACADLwEAQS5GDQYLQQAhBEEAIAJBCmo2ArAKQQIhCEEHIQZBASEHQQEQKSECQQEhBQwBCwJAAkACQAJAIAJB8wBHDQAgAyABTQ0AIANBAmpBoghBChAvDQACQCADLwEMIgRBd2oiB0EXSw0AQQEgB3RBn4CABHENAgsgBEGgAUYNAQtBACEHQQchBkEBIQQgAkHkAEYNAQwCC0EAIQRBACADQQxqIgI2ArAKQQEhBUEBECkhCQJAQQAoArAKIgYgAkYNAEHmACECAkAgCUHmAEYNAEEFIQZBACEHQQEhCCAJIQIMBAtBACEHQQEhCCAGQQJqQawIQQYQLw0EIAYvAQgQIEUNBAtBACEHQQAgAzYCsApBByEGQQEhBEEAIQVBACEIIAkhAgwCCyADIABBCmpNDQBBACEIQeQAIQICQCADKQACQuWAmIPQjIA5Ug0AAkACQCADLwEKIgRBd2oiB0EXSw0AQQEgB3RBn4CABHENAQtBACEIIARBoAFHDQELQQAhBUEAIANBCmo2ArAKQSohAkEBIQdBAiEIQQEQKSIJQSpGDQRBACADNgKwCkEBIQRBACEHQQAhCCAJIQIMAgsgAyEGQQAhBwwCC0EAIQVBACEICwJAIAJBKEcNAEEAKAKkCkEALwGYCiICQQN0aiIDQQAoArAKNgIEQQAgAkEBajsBmAogA0EFNgIAQQAoApwKLwEAQS5GDQRBAEEAKAKwCiIDQQJqNgKwCkEBECkhAiAAQQAoArAKQQAgAxABAkACQCAFDQBBACgC8AkhAQwBC0EAKALwCSIBIAY2AhwLQQBBAC8BlgoiA0EBajsBlgpBACgCqAogA0ECdGogATYCAAJAIAJBIkYNACACQSdGDQBBAEEAKAKwCkF+ajYCsAoPCyACEBpBAEEAKAKwCkECaiICNgKwCgJAAkACQEEBEClBV2oOBAECAgACC0EAQQAoArAKQQJqNgKwCkEBECkaQQAoAvAJIgMgAjYCBCADQQE6ABggA0EAKAKwCiICNgIQQQAgAkF+ajYCsAoPC0EAKALwCSIDIAI2AgQgA0EBOgAYQQBBAC8BmApBf2o7AZgKIANBACgCsApBAmo2AgxBAEEALwGWCkF/ajsBlgoPC0EAQQAoArAKQX5qNgKwCg8LAkAgBEEBcyACQfsAR3INAEEAKAKwCiECQQAvAZgKDQUDQAJAAkACQCACQQAoArQKTw0AQQEQKSICQSJGDQEgAkEnRg0BIAJB/QBHDQJBAEEAKAKwCkECajYCsAoLQQEQKSEDQQAoArAKIQICQCADQeYARw0AIAJBAmpBrAhBBhAvDQcLQQAgAkEIajYCsAoCQEEBECkiAkEiRg0AIAJBJ0cNBwsgACACQQAQKw8LIAIQGgtBAEEAKAKwCkECaiICNgKwCgwACwsCQAJAIAJBWWoOBAMBAQMACyACQSJGDQILQQAoArAKIQYLIAYgAUcNAEEAIABBCmo2ArAKDwsgAkEqRyAHcQ0DQQAvAZgKQf//A3ENA0EAKAKwCiECQQAoArQKIQEDQCACIAFPDQECQAJAIAIvAQAiA0EnRg0AIANBIkcNAQsgACADIAgQKw8LQQAgAkECaiICNgKwCgwACwsQJQsPC0EAIAJBfmo2ArAKDwtBAEEAKAKwCkF+ajYCsAoLRwEDf0EAKAKwCkECaiEAQQAoArQKIQECQANAIAAiAkF+aiABTw0BIAJBAmohACACLwEAQXZqDgQBAAABAAsLQQAgAjYCsAoLmAEBA39BAEEAKAKwCiIBQQJqNgKwCiABQQZqIQFBACgCtAohAgNAAkACQAJAIAFBfGogAk8NACABQX5qLwEAIQMCQAJAIAANACADQSpGDQEgA0F2ag4EAgQEAgQLIANBKkcNAwsgAS8BAEEvRw0CQQAgAUF+ajYCsAoMAQsgAUF+aiEBC0EAIAE2ArAKDwsgAUECaiEBDAALC4gBAQR/QQAoArAKIQFBACgCtAohAgJAAkADQCABIgNBAmohASADIAJPDQEgAS8BACIEIABGDQICQCAEQdwARg0AIARBdmoOBAIBAQIBCyADQQRqIQEgAy8BBEENRw0AIANBBmogASADLwEGQQpGGyEBDAALC0EAIAE2ArAKECUPC0EAIAE2ArAKC2wBAX8CQAJAIABBX2oiAUEFSw0AQQEgAXRBMXENAQsgAEFGakH//wNxQQZJDQAgAEEpRyAAQVhqQf//A3FBB0lxDQACQCAAQaV/ag4EAQAAAQALIABB/QBHIABBhX9qQf//A3FBBElxDwtBAQsuAQF/QQEhAQJAIABBpglBBRAdDQAgAEGWCEEDEB0NACAAQbAJQQIQHSEBCyABC0YBA39BACEDAkAgACACQQF0IgJrIgRBAmoiAEEAKALcCSIFSQ0AIAAgASACEC8NAAJAIAAgBUcNAEEBDwsgBBAmIQMLIAMLgwEBAn9BASEBAkACQAJAAkACQAJAIAAvAQAiAkFFag4EBQQEAQALAkAgAkGbf2oOBAMEBAIACyACQSlGDQQgAkH5AEcNAyAAQX5qQbwJQQYQHQ8LIABBfmovAQBBPUYPCyAAQX5qQbQJQQQQHQ8LIABBfmpByAlBAxAdDwtBACEBCyABC7QDAQJ/QQAhAQJAAkACQAJAAkACQAJAAkACQAJAIAAvAQBBnH9qDhQAAQIJCQkJAwkJBAUJCQYJBwkJCAkLAkACQCAAQX5qLwEAQZd/ag4EAAoKAQoLIABBfGpByghBAhAdDwsgAEF8akHOCEEDEB0PCwJAAkACQCAAQX5qLwEAQY1/ag4DAAECCgsCQCAAQXxqLwEAIgJB4QBGDQAgAkHsAEcNCiAAQXpqQeUAECcPCyAAQXpqQeMAECcPCyAAQXxqQdQIQQQQHQ8LIABBfGpB3AhBBhAdDwsgAEF+ai8BAEHvAEcNBiAAQXxqLwEAQeUARw0GAkAgAEF6ai8BACICQfAARg0AIAJB4wBHDQcgAEF4akHoCEEGEB0PCyAAQXhqQfQIQQIQHQ8LIABBfmpB+AhBBBAdDwtBASEBIABBfmoiAEHpABAnDQQgAEGACUEFEB0PCyAAQX5qQeQAECcPCyAAQX5qQYoJQQcQHQ8LIABBfmpBmAlBBBAdDwsCQCAAQX5qLwEAIgJB7wBGDQAgAkHlAEcNASAAQXxqQe4AECcPCyAAQXxqQaAJQQMQHSEBCyABCzQBAX9BASEBAkAgAEF3akH//wNxQQVJDQAgAEGAAXJBoAFGDQAgAEEuRyAAEChxIQELIAELMAEBfwJAAkAgAEF3aiIBQRdLDQBBASABdEGNgIAEcQ0BCyAAQaABRg0AQQAPC0EBC04BAn9BACEBAkACQCAALwEAIgJB5QBGDQAgAkHrAEcNASAAQX5qQfgIQQQQHQ8LIABBfmovAQBB9QBHDQAgAEF8akHcCEEGEB0hAQsgAQveAQEEf0EAKAKwCiEAQQAoArQKIQECQAJAAkADQCAAIgJBAmohACACIAFPDQECQAJAAkAgAC8BACIDQaR/ag4FAgMDAwEACyADQSRHDQIgAi8BBEH7AEcNAkEAIAJBBGoiADYCsApBAEEALwGYCiICQQFqOwGYCkEAKAKkCiACQQN0aiICQQQ2AgAgAiAANgIEDwtBACAANgKwCkEAQQAvAZgKQX9qIgA7AZgKQQAoAqQKIABB//8DcUEDdGooAgBBA0cNAwwECyACQQRqIQAMAAsLQQAgADYCsAoLECULC3ABAn8CQAJAA0BBAEEAKAKwCiIAQQJqIgE2ArAKIABBACgCtApPDQECQAJAAkAgAS8BACIBQaV/ag4CAQIACwJAIAFBdmoOBAQDAwQACyABQS9HDQIMBAsQLhoMAQtBACAAQQRqNgKwCgwACwsQJQsLNQEBf0EAQQE6APwJQQAoArAKIQBBAEEAKAK0CkECajYCsApBACAAQQAoAtwJa0EBdTYCkAoLQwECf0EBIQECQCAALwEAIgJBd2pB//8DcUEFSQ0AIAJBgAFyQaABRg0AQQAhASACEChFDQAgAkEuRyAAECpyDwsgAQs9AQJ/QQAhAgJAQQAoAtwJIgMgAEsNACAALwEAIAFHDQACQCADIABHDQBBAQ8LIABBfmovAQAQICECCyACC2gBAn9BASEBAkACQCAAQV9qIgJBBUsNAEEBIAJ0QTFxDQELIABB+P8DcUEoRg0AIABBRmpB//8DcUEGSQ0AAkAgAEGlf2oiAkEDSw0AIAJBAUcNAQsgAEGFf2pB//8DcUEESSEBCyABC5wBAQN/QQAoArAKIQECQANAAkACQCABLwEAIgJBL0cNAAJAIAEvAQIiAUEqRg0AIAFBL0cNBBAYDAILIAAQGQwBCwJAAkAgAEUNACACQXdqIgFBF0sNAUEBIAF0QZ+AgARxRQ0BDAILIAIQIUUNAwwBCyACQaABRw0CC0EAQQAoArAKIgNBAmoiATYCsAogA0EAKAK0CkkNAAsLIAILMQEBf0EAIQECQCAALwEAQS5HDQAgAEF+ai8BAEEuRw0AIABBfGovAQBBLkYhAQsgAQumBAEBfwJAIAFBIkYNACABQSdGDQAQJQ8LQQAoArAKIQMgARAaIAAgA0ECakEAKAKwCkEAKALQCRABAkAgAkEBSA0AQQAoAvAJQQRBBiACQQFGGzYCHAtBAEEAKAKwCkECajYCsAoCQAJAAkACQEEAECkiAUHhAEYNACABQfcARg0BQQAoArAKIQEMAgtBACgCsAoiAUECakHACEEKEC8NAUEGIQIMAgtBACgCsAoiAS8BAkHpAEcNACABLwEEQfQARw0AQQQhAiABLwEGQegARg0BC0EAIAFBfmo2ArAKDwtBACABIAJBAXRqNgKwCgJAQQEQKUH7AEYNAEEAIAE2ArAKDwtBACgCsAoiACECA0BBACACQQJqNgKwCgJAAkACQEEBECkiAkEiRg0AIAJBJ0cNAUEnEBpBAEEAKAKwCkECajYCsApBARApIQIMAgtBIhAaQQBBACgCsApBAmo2ArAKQQEQKSECDAELIAIQLCECCwJAIAJBOkYNAEEAIAE2ArAKDwtBAEEAKAKwCkECajYCsAoCQEEBECkiAkEiRg0AIAJBJ0YNAEEAIAE2ArAKDwsgAhAaQQBBACgCsApBAmo2ArAKAkACQEEBECkiAkEsRg0AIAJB/QBGDQFBACABNgKwCg8LQQBBACgCsApBAmo2ArAKQQEQKUH9AEYNAEEAKAKwCiECDAELC0EAKALwCSIBIAA2AhAgAUEAKAKwCkECajYCDAttAQJ/AkACQANAAkAgAEH//wNxIgFBd2oiAkEXSw0AQQEgAnRBn4CABHENAgsgAUGgAUYNASAAIQIgARAoDQJBACECQQBBACgCsAoiAEECajYCsAogAC8BAiIADQAMAgsLIAAhAgsgAkH//wNxC6sBAQR/AkACQEEAKAKwCiICLwEAIgNB4QBGDQAgASEEIAAhBQwBC0EAIAJBBGo2ArAKQQEQKSECQQAoArAKIQUCQAJAIAJBIkYNACACQSdGDQAgAhAsGkEAKAKwCiEEDAELIAIQGkEAQQAoArAKQQJqIgQ2ArAKC0EBECkhA0EAKAKwCiECCwJAIAIgBUYNACAFIARBACAAIAAgAUYiAhtBACABIAIbEAILIAMLcgEEf0EAKAKwCiEAQQAoArQKIQECQAJAA0AgAEECaiECIAAgAU8NAQJAAkAgAi8BACIDQaR/ag4CAQQACyACIQAgA0F2ag4EAgEBAgELIABBBGohAAwACwtBACACNgKwChAlQQAPC0EAIAI2ArAKQd0AC0kBA39BACEDAkAgAkUNAAJAA0AgAC0AACIEIAEtAAAiBUcNASABQQFqIQEgAEEBaiEAIAJBf2oiAg0ADAILCyAEIAVrIQMLIAMLC+wBAgBBgAgLzgEAAHgAcABvAHIAdABtAHAAbwByAHQAZgBvAHIAZQB0AGEAbwB1AHIAYwBlAHIAbwBtAHUAbgBjAHQAaQBvAG4AcwBzAGUAcgB0AHYAbwB5AGkAZQBkAGUAbABlAGMAbwBuAHQAaQBuAGkAbgBzAHQAYQBuAHQAeQBiAHIAZQBhAHIAZQB0AHUAcgBkAGUAYgB1AGcAZwBlAGEAdwBhAGkAdABoAHIAdwBoAGkAbABlAGkAZgBjAGEAdABjAGYAaQBuAGEAbABsAGUAbABzAABB0AkLEAEAAAACAAAAAAQAAEA5AAA=", "undefined" != typeof Buffer ? Buffer.from(A$1, "base64") : Uint8Array.from(atob(A$1), (A$2) => A$2.charCodeAt(0));
|
8121
8139
|
var A$1;
|
8122
8140
|
};
|
8123
|
-
const init
|
8141
|
+
const init = WebAssembly.compile(E()).then(WebAssembly.instantiate).then(({ exports: A$1 }) => {
|
8124
8142
|
C = A$1;
|
8125
8143
|
});
|
8126
8144
|
|
@@ -8275,7 +8293,7 @@ var require_convert_source_map = __commonJS({ "../../node_modules/.pnpm/convert-
|
|
8275
8293
|
|
8276
8294
|
//#endregion
|
8277
8295
|
//#region src/node/server/sourcemap.ts
|
8278
|
-
var import_convert_source_map$2 = __toESM(require_convert_source_map()
|
8296
|
+
var import_convert_source_map$2 = __toESM(require_convert_source_map());
|
8279
8297
|
const debug$16 = createDebugger("vite:sourcemap", { onlyWhenFocused: true });
|
8280
8298
|
const virtualSourceRE = /^(?:dep:|browser-external:|virtual:)|\0/;
|
8281
8299
|
async function computeSourceRoute(map$1, file) {
|
@@ -8473,8 +8491,8 @@ var require_src$1 = __commonJS({ "../../node_modules/.pnpm/lilconfig@3.1.3/node_
|
|
8473
8491
|
/** @type {import('./index').lilconfig} */
|
8474
8492
|
module.exports.lilconfig = function lilconfig(name, options$1) {
|
8475
8493
|
const { ignoreEmptySearchPlaces, loaders, packageProp, searchPlaces, stopDir, transform: transform$2, cache: cache$1 } = getOptions(name, options$1 ?? {}, false);
|
8476
|
-
const searchCache = new Map();
|
8477
|
-
const loadCache = new Map();
|
8494
|
+
const searchCache = /* @__PURE__ */ new Map();
|
8495
|
+
const loadCache = /* @__PURE__ */ new Map();
|
8478
8496
|
const emplace = makeEmplace(cache$1);
|
8479
8497
|
return {
|
8480
8498
|
async search(searchFrom = process.cwd()) {
|
@@ -8484,7 +8502,7 @@ var require_src$1 = __commonJS({ "../../node_modules/.pnpm/lilconfig@3.1.3/node_
|
|
8484
8502
|
filepath: ""
|
8485
8503
|
};
|
8486
8504
|
/** @type {Set<string>} */
|
8487
|
-
const visited = new Set();
|
8505
|
+
const visited = /* @__PURE__ */ new Set();
|
8488
8506
|
let dir = searchFrom;
|
8489
8507
|
dirLoop: while (true) {
|
8490
8508
|
if (cache$1) {
|
@@ -8585,8 +8603,8 @@ var require_src$1 = __commonJS({ "../../node_modules/.pnpm/lilconfig@3.1.3/node_
|
|
8585
8603
|
/** @type {import('./index').lilconfigSync} */
|
8586
8604
|
module.exports.lilconfigSync = function lilconfigSync(name, options$1) {
|
8587
8605
|
const { ignoreEmptySearchPlaces, loaders, packageProp, searchPlaces, stopDir, transform: transform$2, cache: cache$1 } = getOptions(name, options$1 ?? {}, true);
|
8588
|
-
const searchCache = new Map();
|
8589
|
-
const loadCache = new Map();
|
8606
|
+
const searchCache = /* @__PURE__ */ new Map();
|
8607
|
+
const loadCache = /* @__PURE__ */ new Map();
|
8590
8608
|
const emplace = makeEmplace(cache$1);
|
8591
8609
|
return {
|
8592
8610
|
search(searchFrom = process.cwd()) {
|
@@ -8596,7 +8614,7 @@ var require_src$1 = __commonJS({ "../../node_modules/.pnpm/lilconfig@3.1.3/node_
|
|
8596
8614
|
filepath: ""
|
8597
8615
|
};
|
8598
8616
|
/** @type {Set<string>} */
|
8599
|
-
const visited = new Set();
|
8617
|
+
const visited = /* @__PURE__ */ new Set();
|
8600
8618
|
let dir = searchFrom;
|
8601
8619
|
dirLoop: while (true) {
|
8602
8620
|
if (cache$1) {
|
@@ -8696,8 +8714,8 @@ var require_src$1 = __commonJS({ "../../node_modules/.pnpm/lilconfig@3.1.3/node_
|
|
8696
8714
|
} });
|
8697
8715
|
|
8698
8716
|
//#endregion
|
8699
|
-
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.
|
8700
|
-
var require_req = __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.
|
8717
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.4_tsx@4.19.4_yaml@2.8.0/node_modules/postcss-load-config/src/req.js
|
8718
|
+
var require_req = __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.4_tsx@4.19.4_yaml@2.8.0/node_modules/postcss-load-config/src/req.js"(exports, module) {
|
8701
8719
|
const { createRequire: createRequire$2 } = require("node:module");
|
8702
8720
|
const { fileURLToPath: fileURLToPath$1, pathToFileURL: pathToFileURL$1 } = require("node:url");
|
8703
8721
|
const TS_EXT_RE = /\.[mc]?ts$/;
|
@@ -8739,8 +8757,8 @@ var require_req = __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0
|
|
8739
8757
|
} });
|
8740
8758
|
|
8741
8759
|
//#endregion
|
8742
|
-
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.
|
8743
|
-
var require_options = __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.
|
8760
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.4_tsx@4.19.4_yaml@2.8.0/node_modules/postcss-load-config/src/options.js
|
8761
|
+
var require_options = __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.4_tsx@4.19.4_yaml@2.8.0/node_modules/postcss-load-config/src/options.js"(exports, module) {
|
8744
8762
|
const req$2 = require_req();
|
8745
8763
|
/**
|
8746
8764
|
* Load Options
|
@@ -8774,8 +8792,8 @@ var require_options = __commonJS({ "../../node_modules/.pnpm/postcss-load-config
|
|
8774
8792
|
} });
|
8775
8793
|
|
8776
8794
|
//#endregion
|
8777
|
-
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.
|
8778
|
-
var require_plugins = __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.
|
8795
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.4_tsx@4.19.4_yaml@2.8.0/node_modules/postcss-load-config/src/plugins.js
|
8796
|
+
var require_plugins = __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.4_tsx@4.19.4_yaml@2.8.0/node_modules/postcss-load-config/src/plugins.js"(exports, module) {
|
8779
8797
|
const req$1 = require_req();
|
8780
8798
|
/**
|
8781
8799
|
* Plugin Loader
|
@@ -8829,8 +8847,8 @@ var require_plugins = __commonJS({ "../../node_modules/.pnpm/postcss-load-config
|
|
8829
8847
|
} });
|
8830
8848
|
|
8831
8849
|
//#endregion
|
8832
|
-
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.
|
8833
|
-
var require_src = __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.
|
8850
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.4_tsx@4.19.4_yaml@2.8.0/node_modules/postcss-load-config/src/index.js
|
8851
|
+
var require_src = __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.4_tsx@4.19.4_yaml@2.8.0/node_modules/postcss-load-config/src/index.js"(exports, module) {
|
8834
8852
|
const { resolve: resolve$2 } = require("node:path");
|
8835
8853
|
const config$1 = require_src$1();
|
8836
8854
|
const loadOptions = require_options();
|
@@ -9008,7 +9026,7 @@ function resolveCustomResolver(customResolver) {
|
|
9008
9026
|
if (customResolver) return getHookFunction(customResolver.resolveId);
|
9009
9027
|
return null;
|
9010
9028
|
}
|
9011
|
-
function alias
|
9029
|
+
function alias(options$1 = {}) {
|
9012
9030
|
const entries = getEntries(options$1);
|
9013
9031
|
if (entries.length === 0) return {
|
9014
9032
|
name: "alias",
|
@@ -9133,7 +9151,7 @@ function t(e$1, n$2, r$2) {
|
|
9133
9151
|
if ("string" == typeof e$1) return r$2 && r$2.add(e$1), [e$1];
|
9134
9152
|
let i$1, o$1;
|
9135
9153
|
if (Array.isArray(e$1)) {
|
9136
|
-
for (o$1 = r$2 || new Set(), i$1 = 0; i$1 < e$1.length; i$1++) t(e$1[i$1], n$2, o$1);
|
9154
|
+
for (o$1 = r$2 || /* @__PURE__ */ new Set(), i$1 = 0; i$1 < e$1.length; i$1++) t(e$1[i$1], n$2, o$1);
|
9137
9155
|
if (!r$2 && o$1.size) return [...o$1];
|
9138
9156
|
} else for (i$1 in e$1) if (n$2.has(i$1)) return t(e$1[i$1], n$2, r$2);
|
9139
9157
|
}
|
@@ -9239,7 +9257,7 @@ function formatList(array, type = "and") {
|
|
9239
9257
|
return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array[array.length - 1]}`;
|
9240
9258
|
}
|
9241
9259
|
/** @type {Map<string, MessageFunction | string>} */
|
9242
|
-
const messages = new Map();
|
9260
|
+
const messages = /* @__PURE__ */ new Map();
|
9243
9261
|
const nodeInternalPrefix = "__node_internal_";
|
9244
9262
|
/** @type {number} */
|
9245
9263
|
let userStackTraceLimit;
|
@@ -9595,8 +9613,8 @@ function esbuildDepPlugin(environment, qualified, external) {
|
|
9595
9613
|
const { isProduction } = environment.config;
|
9596
9614
|
const { extensions: extensions$1 } = environment.config.optimizeDeps;
|
9597
9615
|
const allExternalTypes = extensions$1 ? externalTypes.filter((type) => !extensions$1.includes("." + type)) : externalTypes;
|
9598
|
-
const esmPackageCache = new Map();
|
9599
|
-
const cjsPackageCache = new Map();
|
9616
|
+
const esmPackageCache = /* @__PURE__ */ new Map();
|
9617
|
+
const cjsPackageCache = /* @__PURE__ */ new Map();
|
9600
9618
|
const _resolve = createBackCompatIdResolver(environment.getTopLevelConfig(), {
|
9601
9619
|
asSrc: false,
|
9602
9620
|
scan: true,
|
@@ -9610,7 +9628,7 @@ function esbuildDepPlugin(environment, qualified, external) {
|
|
9610
9628
|
});
|
9611
9629
|
const resolve$5 = (id, importer, kind, resolveDir) => {
|
9612
9630
|
let _importer;
|
9613
|
-
if (resolveDir) _importer = normalizePath
|
9631
|
+
if (resolveDir) _importer = normalizePath(path.join(resolveDir, "*"));
|
9614
9632
|
else _importer = importer in qualified ? qualified[importer] : importer;
|
9615
9633
|
const resolver = kind.startsWith("require") ? _resolveRequire : _resolve;
|
9616
9634
|
return resolver(environment, id, _importer);
|
@@ -9751,7 +9769,7 @@ module.exports = ${isNodeBuiltin(args.path) ? "m.default" : "{ ...m }"};
|
|
9751
9769
|
|
9752
9770
|
//#endregion
|
9753
9771
|
//#region src/node/baseEnvironment.ts
|
9754
|
-
var import_picocolors$28 = __toESM(require_picocolors()
|
9772
|
+
var import_picocolors$28 = __toESM(require_picocolors());
|
9755
9773
|
const environmentColors = [
|
9756
9774
|
import_picocolors$28.default.blue,
|
9757
9775
|
import_picocolors$28.default.magenta,
|
@@ -10298,9 +10316,9 @@ function stripLiteralDetailed(code, options$1) {
|
|
10298
10316
|
|
10299
10317
|
//#endregion
|
10300
10318
|
//#region src/node/plugins/importMetaGlob.ts
|
10301
|
-
var import_picocolors$27 = __toESM(require_picocolors()
|
10319
|
+
var import_picocolors$27 = __toESM(require_picocolors());
|
10302
10320
|
function importGlobPlugin(config$2) {
|
10303
|
-
const importGlobMaps = new Map();
|
10321
|
+
const importGlobMaps = /* @__PURE__ */ new Map();
|
10304
10322
|
return {
|
10305
10323
|
name: "vite:import-glob",
|
10306
10324
|
buildStart() {
|
@@ -10311,7 +10329,7 @@ function importGlobPlugin(config$2) {
|
|
10311
10329
|
const result = await transformGlobImport(code, id, config$2.root, (im, _, options$1) => this.resolve(im, id, options$1).then((i$1) => i$1?.id || im), config$2.experimental.importGlobRestoreExtension, config$2.logger);
|
10312
10330
|
if (result) {
|
10313
10331
|
const allGlobs = result.matches.map((i$1) => i$1.globsResolved);
|
10314
|
-
if (!importGlobMaps.has(this.environment)) importGlobMaps.set(this.environment, new Map());
|
10332
|
+
if (!importGlobMaps.has(this.environment)) importGlobMaps.set(this.environment, /* @__PURE__ */ new Map());
|
10315
10333
|
const globMatchers = allGlobs.map((globs) => {
|
10316
10334
|
const affirmed = [];
|
10317
10335
|
const negated = [];
|
@@ -10347,7 +10365,8 @@ const knownOptions = {
|
|
10347
10365
|
eager: ["boolean"],
|
10348
10366
|
import: ["string"],
|
10349
10367
|
exhaustive: ["boolean"],
|
10350
|
-
query: ["object", "string"]
|
10368
|
+
query: ["object", "string"],
|
10369
|
+
base: ["string"]
|
10351
10370
|
};
|
10352
10371
|
const forceDefaultAs = ["raw", "url"];
|
10353
10372
|
function err$1(e$1, pos) {
|
@@ -10369,6 +10388,10 @@ function parseGlobOptions(rawOpts, optsStartIndex, logger) {
|
|
10369
10388
|
const valueType = typeof opts[key];
|
10370
10389
|
if (!allowedTypes.includes(valueType)) throw err$1(`Expected glob option "${key}" to be of type ${allowedTypes.join(" or ")}, but got ${valueType}`, optsStartIndex);
|
10371
10390
|
}
|
10391
|
+
if (opts.base) {
|
10392
|
+
if (opts.base[0] === "!") throw err$1("Option \"base\" cannot start with \"!\"", optsStartIndex);
|
10393
|
+
else if (opts.base[0] !== "/" && !opts.base.startsWith("./") && !opts.base.startsWith("../")) throw err$1(`Option "base" must start with '/', './' or '../', but got "${opts.base}"`, optsStartIndex);
|
10394
|
+
}
|
10372
10395
|
if (typeof opts.query === "object") {
|
10373
10396
|
for (const key in opts.query) {
|
10374
10397
|
const value$1 = opts.query[key];
|
@@ -10436,7 +10459,7 @@ async function parseImportGlob(code, importer, root, resolveId, logger) {
|
|
10436
10459
|
if (arg2.type !== "ObjectExpression") throw err$2(`Expected the second argument to be an object literal, but got "${arg2.type}"`);
|
10437
10460
|
options$1 = parseGlobOptions(code.slice(start + arg2.start, start + arg2.end), start + arg2.start, logger);
|
10438
10461
|
}
|
10439
|
-
const globsResolved = await Promise.all(globs.map((glob$1) => toAbsoluteGlob(glob$1, root, importer, resolveId)));
|
10462
|
+
const globsResolved = await Promise.all(globs.map((glob$1) => toAbsoluteGlob(glob$1, root, importer, resolveId, options$1.base)));
|
10440
10463
|
const isRelative$1 = globs.every((i$1) => ".!".includes(i$1[0]));
|
10441
10464
|
const sliceCode = cleanCode.slice(0, start);
|
10442
10465
|
const onlyKeys = objectKeysRE.test(sliceCode);
|
@@ -10480,12 +10503,12 @@ const { basename: basename$2, dirname: dirname$2, relative: relative$2 } = posix
|
|
10480
10503
|
* @param optimizeExport for dynamicImportVar plugin don't need to optimize export.
|
10481
10504
|
*/
|
10482
10505
|
async function transformGlobImport(code, id, root, resolveId, restoreQueryExtension = false, logger) {
|
10483
|
-
id = slash
|
10484
|
-
root = slash
|
10506
|
+
id = slash(id);
|
10507
|
+
root = slash(root);
|
10485
10508
|
const isVirtual = isVirtualModule(id);
|
10486
10509
|
const dir = isVirtual ? void 0 : dirname$2(id);
|
10487
10510
|
const matches$2 = await parseImportGlob(code, isVirtual ? void 0 : id, root, resolveId, logger);
|
10488
|
-
const matchedFiles = new Set();
|
10511
|
+
const matchedFiles = /* @__PURE__ */ new Set();
|
10489
10512
|
if (!matches$2.length) return null;
|
10490
10513
|
const s$2 = new MagicString(code);
|
10491
10514
|
const staticImports = (await Promise.all(matches$2.map(async ({ globsResolved, isRelative: isRelative$1, options: options$1, index, start, end, onlyKeys, onlyValues }) => {
|
@@ -10501,17 +10524,24 @@ async function transformGlobImport(code, id, root, resolveId, restoreQueryExtens
|
|
10501
10524
|
const staticImports$1 = [];
|
10502
10525
|
const resolvePaths = (file) => {
|
10503
10526
|
if (!dir) {
|
10504
|
-
if (isRelative$1) throw new Error("In virtual modules, all globs must start with '/'");
|
10505
|
-
const
|
10527
|
+
if (!options$1.base && isRelative$1) throw new Error("In virtual modules, all globs must start with '/'");
|
10528
|
+
const importPath$1 = `/${relative$2(root, file)}`;
|
10529
|
+
let filePath$1 = options$1.base ? `${relative$2(posix.join(root, options$1.base), file)}` : importPath$1;
|
10530
|
+
if (options$1.base && filePath$1[0] !== ".") filePath$1 = `./${filePath$1}`;
|
10506
10531
|
return {
|
10507
10532
|
filePath: filePath$1,
|
10508
|
-
importPath:
|
10533
|
+
importPath: importPath$1
|
10509
10534
|
};
|
10510
10535
|
}
|
10511
10536
|
let importPath = relative$2(dir, file);
|
10512
10537
|
if (importPath[0] !== ".") importPath = `./${importPath}`;
|
10513
10538
|
let filePath;
|
10514
|
-
if (
|
10539
|
+
if (options$1.base) {
|
10540
|
+
const resolvedBasePath = options$1.base[0] === "/" ? root : dir;
|
10541
|
+
filePath = relative$2(posix.join(resolvedBasePath, options$1.base), file);
|
10542
|
+
if (filePath[0] !== ".") filePath = `./${filePath}`;
|
10543
|
+
if (options$1.base[0] === "/") importPath = `/${relative$2(root, file)}`;
|
10544
|
+
} else if (isRelative$1) filePath = importPath;
|
10515
10545
|
else {
|
10516
10546
|
filePath = relative$2(root, file);
|
10517
10547
|
if (filePath[0] !== ".") filePath = `/${filePath}`;
|
@@ -10565,7 +10595,7 @@ async function transformGlobImport(code, id, root, resolveId, restoreQueryExtens
|
|
10565
10595
|
};
|
10566
10596
|
}
|
10567
10597
|
function globSafePath(path$13) {
|
10568
|
-
return escapePath(normalizePath
|
10598
|
+
return escapePath(normalizePath(path$13));
|
10569
10599
|
}
|
10570
10600
|
function lastNthChar(str, n$2) {
|
10571
10601
|
return str.charAt(str.length - 1 - n$2);
|
@@ -10579,20 +10609,23 @@ function globSafeResolvedPath(resolved, glob$1) {
|
|
10579
10609
|
const dynamicPart = resolved.slice(staticPartEnd);
|
10580
10610
|
return globSafePath(staticPart) + dynamicPart;
|
10581
10611
|
}
|
10582
|
-
async function toAbsoluteGlob(glob$1, root, importer, resolveId) {
|
10612
|
+
async function toAbsoluteGlob(glob$1, root, importer, resolveId, base) {
|
10583
10613
|
let pre = "";
|
10584
10614
|
if (glob$1[0] === "!") {
|
10585
10615
|
pre = "!";
|
10586
10616
|
glob$1 = glob$1.slice(1);
|
10587
10617
|
}
|
10588
10618
|
root = globSafePath(root);
|
10589
|
-
|
10619
|
+
let dir;
|
10620
|
+
if (base) if (base.startsWith("/")) dir = posix.join(root, base);
|
10621
|
+
else dir = posix.resolve(importer ? globSafePath(dirname$2(importer)) : root, base);
|
10622
|
+
else dir = importer ? globSafePath(dirname$2(importer)) : root;
|
10590
10623
|
if (glob$1[0] === "/") return pre + posix.join(root, glob$1.slice(1));
|
10591
10624
|
if (glob$1.startsWith("./")) return pre + posix.join(dir, glob$1.slice(2));
|
10592
10625
|
if (glob$1.startsWith("../")) return pre + posix.join(dir, glob$1);
|
10593
10626
|
if (glob$1.startsWith("**")) return pre + glob$1;
|
10594
10627
|
const isSubImportsPattern = glob$1[0] === "#" && glob$1.includes("*");
|
10595
|
-
const resolved = normalizePath
|
10628
|
+
const resolved = normalizePath(await resolveId(glob$1, importer, { custom: { "vite:import-glob": { isSubImportsPattern } } }) || glob$1);
|
10596
10629
|
if (isAbsolute(resolved)) return pre + globSafeResolvedPath(resolved, glob$1);
|
10597
10630
|
throw new Error(`Invalid glob: "${glob$1}" (resolved: "${resolved}"). It must start with '/' or './'`);
|
10598
10631
|
}
|
@@ -10619,7 +10652,7 @@ function isVirtualModule(id) {
|
|
10619
10652
|
|
10620
10653
|
//#endregion
|
10621
10654
|
//#region src/node/optimizer/scan.ts
|
10622
|
-
var import_picocolors$26 = __toESM(require_picocolors()
|
10655
|
+
var import_picocolors$26 = __toESM(require_picocolors());
|
10623
10656
|
var ScanEnvironment = class extends BaseEnvironment {
|
10624
10657
|
mode = "scan";
|
10625
10658
|
get pluginContainer() {
|
@@ -10736,13 +10769,13 @@ async function computeEntries(environment) {
|
|
10736
10769
|
if (explicitEntryPatterns) entries = await globEntries(explicitEntryPatterns, environment);
|
10737
10770
|
else if (buildInput) {
|
10738
10771
|
const resolvePath = async (p$1) => {
|
10739
|
-
const id = (await environment.pluginContainer.resolveId(p$1,
|
10772
|
+
const id = (await environment.pluginContainer.resolveId(p$1, path.join(process.cwd(), "*"), { scan: true }))?.id;
|
10740
10773
|
if (id === void 0) throw new Error(`failed to resolve rollupOptions.input value: ${JSON.stringify(p$1)}.`);
|
10741
10774
|
return id;
|
10742
10775
|
};
|
10743
10776
|
if (typeof buildInput === "string") entries = [await resolvePath(buildInput)];
|
10744
10777
|
else if (Array.isArray(buildInput)) entries = await Promise.all(buildInput.map(resolvePath));
|
10745
|
-
else if (isObject
|
10778
|
+
else if (isObject(buildInput)) entries = await Promise.all(Object.values(buildInput).map(resolvePath));
|
10746
10779
|
else throw new Error("invalid rollupOptions.input value.");
|
10747
10780
|
} else entries = await globEntries("**/*.html", environment);
|
10748
10781
|
entries = entries.filter((entry) => isScannable(entry, environment.config.optimizeDeps.extensions) && fs.existsSync(entry));
|
@@ -10800,9 +10833,9 @@ const langRE = /\blang\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s'">]+))/i;
|
|
10800
10833
|
const svelteScriptModuleRE = /\bcontext\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s'">]+))/i;
|
10801
10834
|
const svelteModuleRE = /\smodule\b/i;
|
10802
10835
|
function esbuildScanPlugin(environment, depImports, missing, entries) {
|
10803
|
-
const seen$1 = new Map();
|
10836
|
+
const seen$1 = /* @__PURE__ */ new Map();
|
10804
10837
|
async function resolveId(id, importer) {
|
10805
|
-
return environment.pluginContainer.resolveId(id, importer && normalizePath
|
10838
|
+
return environment.pluginContainer.resolveId(id, importer && normalizePath(importer), { scan: true });
|
10806
10839
|
}
|
10807
10840
|
const resolve$5 = async (id, importer) => {
|
10808
10841
|
const key = id + (importer && path.dirname(importer));
|
@@ -10858,7 +10891,7 @@ function esbuildScanPlugin(environment, depImports, missing, entries) {
|
|
10858
10891
|
build$3.onResolve({ filter: htmlTypesRE }, async ({ path: path$13, importer }) => {
|
10859
10892
|
const resolved = await resolve$5(path$13, importer);
|
10860
10893
|
if (!resolved) return;
|
10861
|
-
if (isInNodeModules
|
10894
|
+
if (isInNodeModules(resolved) && isOptimizable(resolved, optimizeDepsOptions)) return;
|
10862
10895
|
return {
|
10863
10896
|
path: resolved,
|
10864
10897
|
namespace: "html"
|
@@ -10891,13 +10924,13 @@ function esbuildScanPlugin(environment, depImports, missing, entries) {
|
|
10891
10924
|
if (contents.includes("import.meta.glob")) scripts[key] = {
|
10892
10925
|
loader: "js",
|
10893
10926
|
contents: await doTransformGlobImport(contents, p$1, loader$1),
|
10894
|
-
resolveDir: normalizePath
|
10927
|
+
resolveDir: normalizePath(path.dirname(p$1)),
|
10895
10928
|
pluginData: { htmlType: { loader: loader$1 } }
|
10896
10929
|
};
|
10897
10930
|
else scripts[key] = {
|
10898
10931
|
loader: loader$1,
|
10899
10932
|
contents,
|
10900
|
-
resolveDir: normalizePath
|
10933
|
+
resolveDir: normalizePath(path.dirname(p$1)),
|
10901
10934
|
pluginData: { htmlType: { loader: loader$1 } }
|
10902
10935
|
};
|
10903
10936
|
const virtualModulePath = JSON.stringify(virtualModulePrefix + key);
|
@@ -10937,7 +10970,7 @@ function esbuildScanPlugin(environment, depImports, missing, entries) {
|
|
10937
10970
|
const resolved = await resolve$5(id, importer);
|
10938
10971
|
if (resolved) {
|
10939
10972
|
if (shouldExternalizeDep(resolved, id)) return externalUnlessEntry({ path: id });
|
10940
|
-
if (isInNodeModules
|
10973
|
+
if (isInNodeModules(resolved) || include?.includes(id)) {
|
10941
10974
|
if (isOptimizable(resolved, optimizeDepsOptions)) depImports[id] = resolved;
|
10942
10975
|
return externalUnlessEntry({ path: id });
|
10943
10976
|
} else if (isScannable(resolved, optimizeDepsOptions.extensions)) {
|
@@ -10947,7 +10980,7 @@ function esbuildScanPlugin(environment, depImports, missing, entries) {
|
|
10947
10980
|
namespace
|
10948
10981
|
};
|
10949
10982
|
} else return externalUnlessEntry({ path: id });
|
10950
|
-
} else missing[id] = normalizePath
|
10983
|
+
} else missing[id] = normalizePath(importer);
|
10951
10984
|
});
|
10952
10985
|
const setupExternalize = (filter$1, doExternalize) => {
|
10953
10986
|
build$3.onResolve({ filter: filter$1 }, ({ path: path$13 }) => {
|
@@ -11031,7 +11064,7 @@ function createOptimizeDepsIncludeResolver(environment) {
|
|
11031
11064
|
const resolve$5 = createBackCompatIdResolver(topLevelConfig, {
|
11032
11065
|
asSrc: false,
|
11033
11066
|
scan: true,
|
11034
|
-
packageCache: new Map()
|
11067
|
+
packageCache: /* @__PURE__ */ new Map()
|
11035
11068
|
});
|
11036
11069
|
return async (id) => {
|
11037
11070
|
const lastArrowIndex = id.lastIndexOf(">");
|
@@ -11066,7 +11099,7 @@ function expandGlobIds(id, config$2) {
|
|
11066
11099
|
ignore: ["node_modules"]
|
11067
11100
|
}).map((filePath) => {
|
11068
11101
|
if (exportsValue.startsWith("./")) filePath = "./" + filePath;
|
11069
|
-
const matched$1 = exportsValueGlobRe.exec(slash
|
11102
|
+
const matched$1 = exportsValueGlobRe.exec(slash(filePath));
|
11070
11103
|
if (matched$1) {
|
11071
11104
|
let allGlobSame = matched$1.length === 2;
|
11072
11105
|
if (!allGlobSame) {
|
@@ -11090,7 +11123,7 @@ function expandGlobIds(id, config$2) {
|
|
11090
11123
|
cwd: pkgData.dir,
|
11091
11124
|
expandDirectories: false,
|
11092
11125
|
ignore: ["node_modules"]
|
11093
|
-
}).map((match) => path.posix.join(pkgName, slash
|
11126
|
+
}).map((match) => path.posix.join(pkgName, slash(match)));
|
11094
11127
|
matched.unshift(pkgName);
|
11095
11128
|
return matched;
|
11096
11129
|
}
|
@@ -11111,7 +11144,7 @@ function nestedResolveBasedir(id, basedir, preserveSymlinks = false) {
|
|
11111
11144
|
|
11112
11145
|
//#endregion
|
11113
11146
|
//#region src/node/optimizer/index.ts
|
11114
|
-
var import_picocolors$25 = __toESM(require_picocolors()
|
11147
|
+
var import_picocolors$25 = __toESM(require_picocolors());
|
11115
11148
|
const debug$14 = createDebugger("vite:deps");
|
11116
11149
|
const jsExtensionRE = /\.js$/i;
|
11117
11150
|
const jsMapExtensionRE = /\.js\.map$/i;
|
@@ -11271,7 +11304,7 @@ function runOptimizeDeps(environment, depsInfo) {
|
|
11271
11304
|
fs.writeFileSync(dataPath, stringifyDepsOptimizerMetadata(metadata, depsCacheDir));
|
11272
11305
|
const temporaryPath = depsCacheDir + getTempSuffix();
|
11273
11306
|
const depsCacheDirPresent = fs.existsSync(depsCacheDir);
|
11274
|
-
if (isWindows
|
11307
|
+
if (isWindows) {
|
11275
11308
|
if (depsCacheDirPresent) {
|
11276
11309
|
debug$14?.(import_picocolors$25.default.green(`renaming ${depsCacheDir} to ${temporaryPath}`));
|
11277
11310
|
await safeRename(depsCacheDir, temporaryPath);
|
@@ -11464,7 +11497,7 @@ function depsFromOptimizedDepInfo(depsInfo) {
|
|
11464
11497
|
return obj;
|
11465
11498
|
}
|
11466
11499
|
function getOptimizedDepPath(environment, id) {
|
11467
|
-
return normalizePath
|
11500
|
+
return normalizePath(path.resolve(getDepsCacheDir(environment), flattenId(id) + ".js"));
|
11468
11501
|
}
|
11469
11502
|
function getDepsCacheSuffix(environment) {
|
11470
11503
|
return environment.name === "client" ? "" : `_${environment.name}`;
|
@@ -11479,7 +11512,7 @@ function getTempSuffix() {
|
|
11479
11512
|
return "_temp_" + getHash(`${process.pid}:${Date.now().toString()}:${Math.random().toString(16).slice(2)}`);
|
11480
11513
|
}
|
11481
11514
|
function getDepsCacheDirPrefix(environment) {
|
11482
|
-
return normalizePath
|
11515
|
+
return normalizePath(path.resolve(environment.config.cacheDir, "deps"));
|
11483
11516
|
}
|
11484
11517
|
function createIsOptimizedDepFile(environment) {
|
11485
11518
|
const depsCacheDirPrefix = getDepsCacheDirPrefix(environment);
|
@@ -11488,15 +11521,15 @@ function createIsOptimizedDepFile(environment) {
|
|
11488
11521
|
function createIsOptimizedDepUrl(environment) {
|
11489
11522
|
const { root } = environment.config;
|
11490
11523
|
const depsCacheDir = getDepsCacheDirPrefix(environment);
|
11491
|
-
const depsCacheDirRelative = normalizePath
|
11492
|
-
const depsCacheDirPrefix = depsCacheDirRelative.startsWith("../") ? `/@fs/${removeLeadingSlash(normalizePath
|
11524
|
+
const depsCacheDirRelative = normalizePath(path.relative(root, depsCacheDir));
|
11525
|
+
const depsCacheDirPrefix = depsCacheDirRelative.startsWith("../") ? `/@fs/${removeLeadingSlash(normalizePath(depsCacheDir))}` : `/${depsCacheDirRelative}`;
|
11493
11526
|
return function isOptimizedDepUrl(url$6) {
|
11494
11527
|
return url$6.startsWith(depsCacheDirPrefix);
|
11495
11528
|
};
|
11496
11529
|
}
|
11497
11530
|
function parseDepsOptimizerMetadata(jsonMetadata, depsCacheDir) {
|
11498
11531
|
const { hash: hash$1, lockfileHash, configHash, browserHash, optimized, chunks } = JSON.parse(jsonMetadata, (key, value$1) => {
|
11499
|
-
if (key === "file" || key === "src") return normalizePath
|
11532
|
+
if (key === "file" || key === "src") return normalizePath(path.resolve(depsCacheDir, value$1));
|
11500
11533
|
return value$1;
|
11501
11534
|
});
|
11502
11535
|
if (!chunks || Object.values(optimized).some((depInfo) => !depInfo.fileHash)) return;
|
@@ -11544,20 +11577,20 @@ function stringifyDepsOptimizerMetadata(metadata, depsCacheDir) {
|
|
11544
11577
|
}])),
|
11545
11578
|
chunks: Object.fromEntries(Object.values(chunks).map(({ id, file }) => [id, { file }]))
|
11546
11579
|
}, (key, value$1) => {
|
11547
|
-
if (key === "file" || key === "src") return normalizePath
|
11580
|
+
if (key === "file" || key === "src") return normalizePath(path.relative(depsCacheDir, value$1));
|
11548
11581
|
return value$1;
|
11549
11582
|
}, 2);
|
11550
11583
|
}
|
11551
11584
|
function esbuildOutputFromId(outputs, id, cacheDirOutputPath) {
|
11552
11585
|
const cwd = process.cwd();
|
11553
11586
|
const flatId = flattenId(id) + ".js";
|
11554
|
-
const normalizedOutputPath = normalizePath
|
11587
|
+
const normalizedOutputPath = normalizePath(path.relative(cwd, path.join(cacheDirOutputPath, flatId)));
|
11555
11588
|
const output = outputs[normalizedOutputPath];
|
11556
11589
|
if (output) return output;
|
11557
|
-
for (const [key, value$1] of Object.entries(outputs)) if (normalizePath
|
11590
|
+
for (const [key, value$1] of Object.entries(outputs)) if (normalizePath(path.relative(cwd, key)) === normalizedOutputPath) return value$1;
|
11558
11591
|
}
|
11559
11592
|
async function extractExportsData(environment, filePath) {
|
11560
|
-
await init
|
11593
|
+
await init;
|
11561
11594
|
const { optimizeDeps: optimizeDeps$1 } = environment.config;
|
11562
11595
|
const esbuildOptions = optimizeDeps$1.esbuildOptions ?? {};
|
11563
11596
|
if (optimizeDeps$1.extensions?.some((ext) => filePath.endsWith(ext))) {
|
@@ -11567,7 +11600,7 @@ async function extractExportsData(environment, filePath) {
|
|
11567
11600
|
write: false,
|
11568
11601
|
format: "esm"
|
11569
11602
|
});
|
11570
|
-
const [, exports$2, , hasModuleSyntax$1] = parse
|
11603
|
+
const [, exports$2, , hasModuleSyntax$1] = parse(result.outputFiles[0].text);
|
11571
11604
|
return {
|
11572
11605
|
hasModuleSyntax: hasModuleSyntax$1,
|
11573
11606
|
exports: exports$2.map((e$1) => e$1.n)
|
@@ -11577,12 +11610,12 @@ async function extractExportsData(environment, filePath) {
|
|
11577
11610
|
let usedJsxLoader = false;
|
11578
11611
|
const entryContent = await fsp.readFile(filePath, "utf-8");
|
11579
11612
|
try {
|
11580
|
-
parseResult = parse
|
11613
|
+
parseResult = parse(entryContent);
|
11581
11614
|
} catch {
|
11582
11615
|
const loader$1 = esbuildOptions.loader?.[path.extname(filePath)] || "jsx";
|
11583
11616
|
debug$14?.(`Unable to parse: ${filePath}.\n Trying again with a ${loader$1} transform.`);
|
11584
11617
|
const transformed = await transformWithEsbuild(entryContent, filePath, { loader: loader$1 }, void 0, environment.config);
|
11585
|
-
parseResult = parse
|
11618
|
+
parseResult = parse(transformed.code);
|
11586
11619
|
usedJsxLoader = true;
|
11587
11620
|
}
|
11588
11621
|
const [, exports$1, , hasModuleSyntax] = parseResult;
|
@@ -11766,7 +11799,7 @@ const safeRename = promisify(function gracefulRename(from, to, cb) {
|
|
11766
11799
|
//#endregion
|
11767
11800
|
//#region src/node/external.ts
|
11768
11801
|
const debug$13 = createDebugger("vite:external");
|
11769
|
-
const isExternalCache = new WeakMap();
|
11802
|
+
const isExternalCache = /* @__PURE__ */ new WeakMap();
|
11770
11803
|
function shouldExternalize(environment, id, importer) {
|
11771
11804
|
let isExternal$1 = isExternalCache.get(environment);
|
11772
11805
|
if (!isExternal$1) {
|
@@ -11779,7 +11812,7 @@ function createIsConfiguredAsExternal(environment) {
|
|
11779
11812
|
const { config: config$2 } = environment;
|
11780
11813
|
const { root, resolve: resolve$5 } = config$2;
|
11781
11814
|
const { external, noExternal } = resolve$5;
|
11782
|
-
const noExternalFilter = typeof noExternal !== "boolean" && !(Array.isArray(noExternal) && noExternal.length === 0) && createFilter
|
11815
|
+
const noExternalFilter = typeof noExternal !== "boolean" && !(Array.isArray(noExternal) && noExternal.length === 0) && createFilter(void 0, noExternal, { resolve: false });
|
11783
11816
|
const targetConditions = resolve$5.externalConditions;
|
11784
11817
|
const resolveOptions = {
|
11785
11818
|
...resolve$5,
|
@@ -11793,7 +11826,7 @@ function createIsConfiguredAsExternal(environment) {
|
|
11793
11826
|
try {
|
11794
11827
|
const resolved = tryNodeResolve(id, config$2.command === "build" ? void 0 : importer, resolveOptions, void 0, false);
|
11795
11828
|
if (!resolved) return false;
|
11796
|
-
if (!configuredAsExternal && !isInNodeModules
|
11829
|
+
if (!configuredAsExternal && !isInNodeModules(resolved.id)) return false;
|
11797
11830
|
return canExternalizeFile(resolved.id);
|
11798
11831
|
} catch {
|
11799
11832
|
debug$13?.(`Failed to node resolve "${id}". Skipping externalizing it by default.`);
|
@@ -11811,7 +11844,7 @@ function createIsConfiguredAsExternal(environment) {
|
|
11811
11844
|
};
|
11812
11845
|
}
|
11813
11846
|
function createIsExternal(environment) {
|
11814
|
-
const processedIds = new Map();
|
11847
|
+
const processedIds = /* @__PURE__ */ new Map();
|
11815
11848
|
const isConfiguredAsExternal = createIsConfiguredAsExternal(environment);
|
11816
11849
|
return (id, importer) => {
|
11817
11850
|
if (processedIds.has(id)) return processedIds.get(id);
|
@@ -11828,9 +11861,9 @@ function canExternalizeFile(filePath) {
|
|
11828
11861
|
|
11829
11862
|
//#endregion
|
11830
11863
|
//#region src/node/plugins/resolve.ts
|
11831
|
-
var import_picocolors$24 = __toESM(require_picocolors()
|
11832
|
-
const normalizedClientEntry$1 = normalizePath
|
11833
|
-
const normalizedEnvEntry$1 = normalizePath
|
11864
|
+
var import_picocolors$24 = __toESM(require_picocolors());
|
11865
|
+
const normalizedClientEntry$1 = normalizePath(CLIENT_ENTRY);
|
11866
|
+
const normalizedEnvEntry$1 = normalizePath(ENV_ENTRY);
|
11834
11867
|
const ERR_RESOLVE_PACKAGE_ENTRY_FAIL = "ERR_RESOLVE_PACKAGE_ENTRY_FAIL";
|
11835
11868
|
const browserExternalId = "__vite-browser-external";
|
11836
11869
|
const optionalPeerDepId = "__vite-optional-peer-dep";
|
@@ -11857,11 +11890,11 @@ function resolvePlugin(resolveOptions) {
|
|
11857
11890
|
const resolvedImports = resolveSubpathImports(id, importer, options$1);
|
11858
11891
|
if (resolvedImports) {
|
11859
11892
|
id = resolvedImports;
|
11860
|
-
if (resolveOpts.custom?.["vite:import-glob"]?.isSubImportsPattern) return normalizePath
|
11893
|
+
if (resolveOpts.custom?.["vite:import-glob"]?.isSubImportsPattern) return normalizePath(path.join(root, id));
|
11861
11894
|
}
|
11862
11895
|
let res;
|
11863
11896
|
if (asSrc && depsOptimizer?.isOptimizedDepUrl(id)) {
|
11864
|
-
const optimizedPath = id.startsWith(FS_PREFIX) ? fsPathFromId(id) : normalizePath
|
11897
|
+
const optimizedPath = id.startsWith(FS_PREFIX) ? fsPathFromId(id) : normalizePath(path.resolve(root, id.slice(1)));
|
11865
11898
|
return optimizedPath;
|
11866
11899
|
}
|
11867
11900
|
if (asSrc && id.startsWith(FS_PREFIX)) {
|
@@ -11879,7 +11912,7 @@ function resolvePlugin(resolveOptions) {
|
|
11879
11912
|
if (id[0] === "." || (preferRelative || importer?.endsWith(".html")) && startsWithWordCharRE.test(id)) {
|
11880
11913
|
const basedir = importer ? path.dirname(importer) : process.cwd();
|
11881
11914
|
const fsPath = path.resolve(basedir, id);
|
11882
|
-
const normalizedFsPath = normalizePath
|
11915
|
+
const normalizedFsPath = normalizePath(fsPath);
|
11883
11916
|
if (depsOptimizer?.isOptimizedDepFile(normalizedFsPath)) {
|
11884
11917
|
if (!options$1.isBuild && !DEP_VERSION_RE.test(normalizedFsPath)) {
|
11885
11918
|
const browserHash = optimizedDepInfoFromFile(depsOptimizer.metadata, normalizedFsPath)?.browserHash;
|
@@ -11905,7 +11938,7 @@ function resolvePlugin(resolveOptions) {
|
|
11905
11938
|
const { file, postfix } = splitFileAndPostfix(id);
|
11906
11939
|
id = fileURLToPath(file) + postfix;
|
11907
11940
|
}
|
11908
|
-
if (isWindows
|
11941
|
+
if (isWindows && id[0] === "/") {
|
11909
11942
|
const basedir = importer ? path.dirname(importer) : process.cwd();
|
11910
11943
|
const fsPath = path.resolve(basedir, id);
|
11911
11944
|
if (res = tryFsResolve(fsPath, options$1)) {
|
@@ -11993,7 +12026,7 @@ function resolveSubpathImports(id, importer, options$1) {
|
|
11993
12026
|
}
|
11994
12027
|
function ensureVersionQuery(resolved, id, options$1, depsOptimizer) {
|
11995
12028
|
if (!options$1.isBuild && !options$1.scan && depsOptimizer && !(resolved === normalizedClientEntry$1 || resolved === normalizedEnvEntry$1)) {
|
11996
|
-
const isNodeModule = isInNodeModules
|
12029
|
+
const isNodeModule = isInNodeModules(id) || isInNodeModules(resolved);
|
11997
12030
|
if (isNodeModule && !DEP_VERSION_RE.test(resolved)) {
|
11998
12031
|
const versionHash = depsOptimizer.metadata.browserHash;
|
11999
12032
|
if (versionHash && isOptimizable(resolved, depsOptimizer.options)) resolved = injectQuery(resolved, `v=${versionHash}`);
|
@@ -12003,7 +12036,7 @@ function ensureVersionQuery(resolved, id, options$1, depsOptimizer) {
|
|
12003
12036
|
}
|
12004
12037
|
function tryFsResolve(fsPath, options$1, tryIndex = true, skipPackageJson = false) {
|
12005
12038
|
const hashIndex = fsPath.indexOf("#");
|
12006
|
-
if (hashIndex >= 0 && isInNodeModules
|
12039
|
+
if (hashIndex >= 0 && isInNodeModules(fsPath)) {
|
12007
12040
|
const queryIndex = fsPath.indexOf("?");
|
12008
12041
|
if (queryIndex < 0 || queryIndex > hashIndex) {
|
12009
12042
|
const file$1 = queryIndex > hashIndex ? fsPath.slice(0, queryIndex) : fsPath;
|
@@ -12110,10 +12143,10 @@ function tryNodeResolve(id, importer, options$1, depsOptimizer, externalize) {
|
|
12110
12143
|
id: resolved,
|
12111
12144
|
moduleSideEffects: pkg.hasSideEffects(resolved)
|
12112
12145
|
});
|
12113
|
-
if (!isInNodeModules
|
12146
|
+
if (!isInNodeModules(resolved) || !depsOptimizer || options$1.scan) return { id: resolved };
|
12114
12147
|
const isJsType = isOptimizable(resolved, depsOptimizer.options);
|
12115
12148
|
const exclude = depsOptimizer.options.exclude;
|
12116
|
-
const skipOptimization = depsOptimizer.options.noDiscovery || !isJsType || importer && isInNodeModules
|
12149
|
+
const skipOptimization = depsOptimizer.options.noDiscovery || !isJsType || importer && isInNodeModules(importer) || exclude?.includes(pkgId) || exclude?.includes(id) || SPECIAL_QUERY_RE.test(resolved);
|
12117
12150
|
if (skipOptimization) {
|
12118
12151
|
const versionHash = depsOptimizer.metadata.browserHash;
|
12119
12152
|
if (versionHash && isJsType) resolved = injectQuery(resolved, `v=${versionHash}`);
|
@@ -12139,7 +12172,7 @@ async function tryOptimizedResolve(depsOptimizer, id, importer, preserveSymlinks
|
|
12139
12172
|
if (!pkgName) break;
|
12140
12173
|
idPkgDir = resolvePackageData(pkgName, importer, preserveSymlinks, packageCache)?.dir;
|
12141
12174
|
if (idPkgDir == null) break;
|
12142
|
-
idPkgDir = normalizePath
|
12175
|
+
idPkgDir = normalizePath(idPkgDir);
|
12143
12176
|
}
|
12144
12177
|
if (optimizedData.src.startsWith(withTrailingSlash(idPkgDir))) return depsOptimizer.getOptimizedDepId(optimizedData);
|
12145
12178
|
}
|
@@ -12173,7 +12206,7 @@ function resolvePackageEntry(id, { dir, data, setResolvedCache, getResolvedCache
|
|
12173
12206
|
skipPackageJson = true;
|
12174
12207
|
} else {
|
12175
12208
|
const { browser: browserField } = data;
|
12176
|
-
if (options$1.mainFields.includes("browser") && isObject
|
12209
|
+
if (options$1.mainFields.includes("browser") && isObject(browserField)) entry = mapWithBrowserField(entry, browserField) || entry;
|
12177
12210
|
}
|
12178
12211
|
const entryPointPath = path.join(dir, entry);
|
12179
12212
|
const resolvedEntryPoint = tryFsResolve(entryPointPath, options$1, true, skipPackageJson);
|
@@ -12213,14 +12246,14 @@ function resolveDeepImport(id, { setResolvedCache, getResolvedCache, dir, data }
|
|
12213
12246
|
let relativeId = id;
|
12214
12247
|
const { exports: exportsField, browser: browserField } = data;
|
12215
12248
|
if (exportsField) {
|
12216
|
-
if (isObject
|
12249
|
+
if (isObject(exportsField) && !Array.isArray(exportsField)) {
|
12217
12250
|
const { file, postfix } = splitFileAndPostfix(relativeId);
|
12218
12251
|
const exportsId = resolveExportsOrImports(data, file, options$1, "exports");
|
12219
12252
|
if (exportsId !== void 0) relativeId = exportsId + postfix;
|
12220
12253
|
else relativeId = void 0;
|
12221
12254
|
} else relativeId = void 0;
|
12222
12255
|
if (!relativeId) throw new Error(`Package subpath '${relativeId}' is not defined by "exports" in ${path.join(dir, "package.json")}.`);
|
12223
|
-
} else if (options$1.mainFields.includes("browser") && isObject
|
12256
|
+
} else if (options$1.mainFields.includes("browser") && isObject(browserField)) {
|
12224
12257
|
const { file, postfix } = splitFileAndPostfix(relativeId);
|
12225
12258
|
const mapped = mapWithBrowserField(file, browserField);
|
12226
12259
|
if (mapped) relativeId = mapped + postfix;
|
@@ -12241,8 +12274,8 @@ function resolveDeepImport(id, { setResolvedCache, getResolvedCache, dir, data }
|
|
12241
12274
|
function tryResolveBrowserMapping(id, importer, options$1, isFilePath, externalize) {
|
12242
12275
|
let res;
|
12243
12276
|
const pkg = importer && findNearestPackageData(path.dirname(importer), options$1.packageCache);
|
12244
|
-
if (pkg && isObject
|
12245
|
-
const mapId = isFilePath ? "./" + slash
|
12277
|
+
if (pkg && isObject(pkg.data.browser)) {
|
12278
|
+
const mapId = isFilePath ? "./" + slash(path.relative(pkg.dir, id)) : id;
|
12246
12279
|
const browserMappedPath = mapWithBrowserField(mapId, pkg.data.browser);
|
12247
12280
|
if (browserMappedPath) {
|
12248
12281
|
if (res = bareImportRE.test(browserMappedPath) ? tryNodeResolve(browserMappedPath, importer, options$1, void 0, void 0)?.id : tryFsResolve(path.join(pkg.dir, browserMappedPath), options$1)) {
|
@@ -12265,7 +12298,7 @@ function tryResolveBrowserMapping(id, importer, options$1, isFilePath, externali
|
|
12265
12298
|
}
|
12266
12299
|
}
|
12267
12300
|
function tryResolveBrowserEntry(dir, data, options$1) {
|
12268
|
-
const browserEntry = typeof data.browser === "string" ? data.browser : isObject
|
12301
|
+
const browserEntry = typeof data.browser === "string" ? data.browser : isObject(data.browser) && data.browser["."];
|
12269
12302
|
if (browserEntry) if (!options$1.isRequire && options$1.mainFields.includes("module") && typeof data.module === "string" && data.module !== browserEntry) {
|
12270
12303
|
const resolvedBrowserEntry = tryFsResolve(path.join(dir, browserEntry), options$1);
|
12271
12304
|
if (resolvedBrowserEntry) {
|
@@ -12314,7 +12347,7 @@ function tryResolveRealFileOrType(file, preserveSymlinks) {
|
|
12314
12347
|
}
|
12315
12348
|
function getRealPath(resolved, preserveSymlinks) {
|
12316
12349
|
if (!preserveSymlinks) resolved = safeRealpathSync(resolved);
|
12317
|
-
return normalizePath
|
12350
|
+
return normalizePath(resolved);
|
12318
12351
|
}
|
12319
12352
|
function isDirectory(path$13) {
|
12320
12353
|
const stat$4 = tryStatSync(path$13);
|
@@ -12323,7 +12356,7 @@ function isDirectory(path$13) {
|
|
12323
12356
|
|
12324
12357
|
//#endregion
|
12325
12358
|
//#region src/node/plugins/optimizedDeps.ts
|
12326
|
-
var import_picocolors$23 = __toESM(require_picocolors()
|
12359
|
+
var import_picocolors$23 = __toESM(require_picocolors());
|
12327
12360
|
const debug$11 = createDebugger("vite:optimize-deps");
|
12328
12361
|
function optimizedDepsPlugin() {
|
12329
12362
|
return {
|
@@ -12458,7 +12491,7 @@ var require_main$1 = __commonJS({ "../../node_modules/.pnpm/dotenv@16.5.0/node_m
|
|
12458
12491
|
const packageJson = require_package();
|
12459
12492
|
const version = packageJson.version;
|
12460
12493
|
const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;
|
12461
|
-
function parse$
|
12494
|
+
function parse$13(src) {
|
12462
12495
|
const obj = {};
|
12463
12496
|
let lines = src.toString();
|
12464
12497
|
lines = lines.replace(/\r\n?/gm, "\n");
|
@@ -12650,7 +12683,7 @@ var require_main$1 = __commonJS({ "../../node_modules/.pnpm/dotenv@16.5.0/node_m
|
|
12650
12683
|
_parseVault,
|
12651
12684
|
config,
|
12652
12685
|
decrypt,
|
12653
|
-
parse: parse$
|
12686
|
+
parse: parse$13,
|
12654
12687
|
populate
|
12655
12688
|
};
|
12656
12689
|
module.exports.configDotenv = DotenvModule.configDotenv;
|
@@ -12677,7 +12710,7 @@ var require_main = __commonJS({ "../../node_modules/.pnpm/dotenv-expand@12.0.2_p
|
|
12677
12710
|
const regex = /(?<!\\)\${([^{}]+)}|(?<!\\)\$([A-Za-z_][A-Za-z0-9_]*)/g;
|
12678
12711
|
let result = value$1;
|
12679
12712
|
let match;
|
12680
|
-
const seen$1 = new Set();
|
12713
|
+
const seen$1 = /* @__PURE__ */ new Set();
|
12681
12714
|
while ((match = regex.exec(result)) !== null) {
|
12682
12715
|
seen$1.add(result);
|
12683
12716
|
const [template, bracedExpression, unbracedExpression] = match;
|
@@ -12721,8 +12754,8 @@ var require_main = __commonJS({ "../../node_modules/.pnpm/dotenv-expand@12.0.2_p
|
|
12721
12754
|
|
12722
12755
|
//#endregion
|
12723
12756
|
//#region src/node/env.ts
|
12724
|
-
var import_main = __toESM(require_main$1()
|
12725
|
-
var import_main$1 = __toESM(require_main()
|
12757
|
+
var import_main = __toESM(require_main$1());
|
12758
|
+
var import_main$1 = __toESM(require_main());
|
12726
12759
|
const debug$10 = createDebugger("vite:env");
|
12727
12760
|
function getEnvFilesForMode(mode, envDir) {
|
12728
12761
|
if (envDir !== false) return [
|
@@ -12730,7 +12763,7 @@ function getEnvFilesForMode(mode, envDir) {
|
|
12730
12763
|
`.env.local`,
|
12731
12764
|
`.env.${mode}`,
|
12732
12765
|
`.env.${mode}.local`
|
12733
|
-
].map((file) => normalizePath
|
12766
|
+
].map((file) => normalizePath(path.join(envDir, file)));
|
12734
12767
|
return [];
|
12735
12768
|
}
|
12736
12769
|
function loadEnv(mode, envDir, prefixes = "VITE_") {
|
@@ -12767,7 +12800,7 @@ function resolveEnvPrefix({ envPrefix = "VITE_" }) {
|
|
12767
12800
|
|
12768
12801
|
//#endregion
|
12769
12802
|
//#region src/node/deprecations.ts
|
12770
|
-
var import_picocolors$22 = __toESM(require_picocolors()
|
12803
|
+
var import_picocolors$22 = __toESM(require_picocolors());
|
12771
12804
|
const docsURL = "https://vite.dev";
|
12772
12805
|
const deprecationCode = {
|
12773
12806
|
removePluginHookSsrArgument: "changes/this-environment-in-hooks",
|
@@ -12817,7 +12850,7 @@ function ignoreDeprecationWarnings(fn) {
|
|
12817
12850
|
|
12818
12851
|
//#endregion
|
12819
12852
|
//#region src/node/server/middlewares/error.ts
|
12820
|
-
var import_picocolors$21 = __toESM(require_picocolors()
|
12853
|
+
var import_picocolors$21 = __toESM(require_picocolors());
|
12821
12854
|
function prepareError(err$2) {
|
12822
12855
|
return {
|
12823
12856
|
message: stripVTControlCharacters(err$2.message),
|
@@ -12917,7 +12950,7 @@ var require_ms = __commonJS({ "../../node_modules/.pnpm/ms@2.0.0/node_modules/ms
|
|
12917
12950
|
module.exports = function(val, options$1) {
|
12918
12951
|
options$1 = options$1 || {};
|
12919
12952
|
var type = typeof val;
|
12920
|
-
if (type === "string" && val.length > 0) return parse$
|
12953
|
+
if (type === "string" && val.length > 0) return parse$11(val);
|
12921
12954
|
else if (type === "number" && isNaN(val) === false) return options$1.long ? fmtLong(val) : fmtShort(val);
|
12922
12955
|
throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
|
12923
12956
|
};
|
@@ -12928,7 +12961,7 @@ var require_ms = __commonJS({ "../../node_modules/.pnpm/ms@2.0.0/node_modules/ms
|
|
12928
12961
|
* @return {Number}
|
12929
12962
|
* @api private
|
12930
12963
|
*/
|
12931
|
-
function parse$
|
12964
|
+
function parse$11(str) {
|
12932
12965
|
str = String(str);
|
12933
12966
|
if (str.length > 100) return;
|
12934
12967
|
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
|
@@ -13056,7 +13089,7 @@ var require_debug$1 = __commonJS({ "../../node_modules/.pnpm/debug@2.6.9/node_mo
|
|
13056
13089
|
function debug$19() {
|
13057
13090
|
if (!debug$19.enabled) return;
|
13058
13091
|
var self$1 = debug$19;
|
13059
|
-
var curr =
|
13092
|
+
var curr = +/* @__PURE__ */ new Date();
|
13060
13093
|
var ms = curr - (prevTime || curr);
|
13061
13094
|
self$1.diff = ms;
|
13062
13095
|
self$1.prev = prevTime;
|
@@ -13158,7 +13191,7 @@ var require_node = __commonJS({ "../../node_modules/.pnpm/debug@2.6.9/node_modul
|
|
13158
13191
|
* Expose `debug()` as the module.
|
13159
13192
|
*/
|
13160
13193
|
exports = module.exports = require_debug$1();
|
13161
|
-
exports.init = init;
|
13194
|
+
exports.init = init$1;
|
13162
13195
|
exports.log = log;
|
13163
13196
|
exports.formatArgs = formatArgs;
|
13164
13197
|
exports.save = save;
|
@@ -13238,7 +13271,7 @@ var require_node = __commonJS({ "../../node_modules/.pnpm/debug@2.6.9/node_modul
|
|
13238
13271
|
var prefix$1 = " \x1B[3" + c + ";1m" + name + " \x1B[0m";
|
13239
13272
|
args[0] = prefix$1 + args[0].split("\n").join("\n" + prefix$1);
|
13240
13273
|
args.push("\x1B[3" + c + "m+" + exports.humanize(this.diff) + "\x1B[0m");
|
13241
|
-
} else args[0] = new Date().toUTCString() + " " + name + " " + args[0];
|
13274
|
+
} else args[0] = (/* @__PURE__ */ new Date()).toUTCString() + " " + name + " " + args[0];
|
13242
13275
|
}
|
13243
13276
|
/**
|
13244
13277
|
* Invokes `util.format()` with the specified arguments and writes to `stream`.
|
@@ -13310,7 +13343,7 @@ var require_node = __commonJS({ "../../node_modules/.pnpm/debug@2.6.9/node_modul
|
|
13310
13343
|
* Create a new `inspectOpts` object in case `useColors` is set
|
13311
13344
|
* differently for a particular `debug` instance.
|
13312
13345
|
*/
|
13313
|
-
function init(debug$19) {
|
13346
|
+
function init$1(debug$19) {
|
13314
13347
|
debug$19.inspectOpts = {};
|
13315
13348
|
var keys = Object.keys(exports.inspectOpts);
|
13316
13349
|
for (var i$1 = 0; i$1 < keys.length; i$1++) debug$19.inspectOpts[keys[i$1]] = exports.inspectOpts[keys[i$1]];
|
@@ -13636,7 +13669,7 @@ var require_parseurl = __commonJS({ "../../node_modules/.pnpm/parseurl@1.3.3/nod
|
|
13636
13669
|
* @private
|
13637
13670
|
*/
|
13638
13671
|
var url$4 = require("url");
|
13639
|
-
var parse$
|
13672
|
+
var parse$10 = url$4.parse;
|
13640
13673
|
var Url = url$4.Url;
|
13641
13674
|
/**
|
13642
13675
|
* Module exports.
|
@@ -13684,7 +13717,7 @@ var require_parseurl = __commonJS({ "../../node_modules/.pnpm/parseurl@1.3.3/nod
|
|
13684
13717
|
* @private
|
13685
13718
|
*/
|
13686
13719
|
function fastparse(str) {
|
13687
|
-
if (typeof str !== "string" || str.charCodeAt(0) !== 47) return parse$
|
13720
|
+
if (typeof str !== "string" || str.charCodeAt(0) !== 47) return parse$10(str);
|
13688
13721
|
var pathname = str;
|
13689
13722
|
var query = null;
|
13690
13723
|
var search = null;
|
@@ -13703,7 +13736,7 @@ var require_parseurl = __commonJS({ "../../node_modules/.pnpm/parseurl@1.3.3/nod
|
|
13703
13736
|
case 32:
|
13704
13737
|
case 35:
|
13705
13738
|
case 160:
|
13706
|
-
case 65279: return parse$
|
13739
|
+
case 65279: return parse$10(str);
|
13707
13740
|
}
|
13708
13741
|
var url$6 = Url !== void 0 ? new Url() : {};
|
13709
13742
|
url$6.path = str;
|
@@ -14440,11 +14473,11 @@ var require_vary = __commonJS({ "../../node_modules/.pnpm/vary@1.1.2/node_module
|
|
14440
14473
|
function append$1(header, field) {
|
14441
14474
|
if (typeof header !== "string") throw new TypeError("header argument is required");
|
14442
14475
|
if (!field) throw new TypeError("field argument is required");
|
14443
|
-
var fields = !Array.isArray(field) ? parse$
|
14476
|
+
var fields = !Array.isArray(field) ? parse$9(String(field)) : field;
|
14444
14477
|
for (var j = 0; j < fields.length; j++) if (!FIELD_NAME_REGEXP.test(fields[j])) throw new TypeError("field argument contains an invalid header name");
|
14445
14478
|
if (header === "*") return header;
|
14446
14479
|
var val = header;
|
14447
|
-
var vals = parse$
|
14480
|
+
var vals = parse$9(header.toLowerCase());
|
14448
14481
|
if (fields.indexOf("*") !== -1 || vals.indexOf("*") !== -1) return "*";
|
14449
14482
|
for (var i$1 = 0; i$1 < fields.length; i$1++) {
|
14450
14483
|
var fld = fields[i$1].toLowerCase();
|
@@ -14462,7 +14495,7 @@ var require_vary = __commonJS({ "../../node_modules/.pnpm/vary@1.1.2/node_module
|
|
14462
14495
|
* @return {Array}
|
14463
14496
|
* @private
|
14464
14497
|
*/
|
14465
|
-
function parse$
|
14498
|
+
function parse$9(header) {
|
14466
14499
|
var end = 0;
|
14467
14500
|
var list = [];
|
14468
14501
|
var start = 0;
|
@@ -14951,7 +14984,7 @@ var require_normalize_path = __commonJS({ "../../node_modules/.pnpm/normalize-pa
|
|
14951
14984
|
var require_anymatch = __commonJS({ "../../node_modules/.pnpm/anymatch@3.1.3/node_modules/anymatch/index.js"(exports, module) {
|
14952
14985
|
Object.defineProperty(exports, "__esModule", { value: true });
|
14953
14986
|
const picomatch$1 = require("picomatch");
|
14954
|
-
const normalizePath$
|
14987
|
+
const normalizePath$2 = require_normalize_path();
|
14955
14988
|
/**
|
14956
14989
|
* @typedef {(testString: string) => boolean} AnymatchFn
|
14957
14990
|
* @typedef {string|RegExp|AnymatchFn} AnymatchPattern
|
@@ -14985,7 +15018,7 @@ var require_anymatch = __commonJS({ "../../node_modules/.pnpm/anymatch@3.1.3/nod
|
|
14985
15018
|
const isList = Array.isArray(args);
|
14986
15019
|
const _path = isList ? args[0] : args;
|
14987
15020
|
if (!isList && typeof _path !== "string") throw new TypeError("anymatch: second argument must be a string: got " + Object.prototype.toString.call(_path));
|
14988
|
-
const path$13 = normalizePath$
|
15021
|
+
const path$13 = normalizePath$2(_path, false);
|
14989
15022
|
for (let index = 0; index < negPatterns.length; index++) {
|
14990
15023
|
const nglob = negPatterns[index];
|
14991
15024
|
if (nglob(path$13)) return returnIndex ? -1 : false;
|
@@ -15144,7 +15177,7 @@ var require_glob_parent = __commonJS({ "../../node_modules/.pnpm/glob-parent@5.1
|
|
15144
15177
|
var isGlob$1 = require_is_glob();
|
15145
15178
|
var pathPosixDirname = require("path").posix.dirname;
|
15146
15179
|
var isWin32 = require("os").platform() === "win32";
|
15147
|
-
var slash = "/";
|
15180
|
+
var slash$1 = "/";
|
15148
15181
|
var backslash = /\\/g;
|
15149
15182
|
var enclosure = /[\{\[].*[\}\]]$/;
|
15150
15183
|
var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
|
@@ -15157,8 +15190,8 @@ var require_glob_parent = __commonJS({ "../../node_modules/.pnpm/glob-parent@5.1
|
|
15157
15190
|
*/
|
15158
15191
|
module.exports = function globParent$1(str, opts) {
|
15159
15192
|
var options$1 = Object.assign({ flipBackslashes: true }, opts);
|
15160
|
-
if (options$1.flipBackslashes && isWin32 && str.indexOf(slash) < 0) str = str.replace(backslash, slash);
|
15161
|
-
if (enclosure.test(str)) str += slash;
|
15193
|
+
if (options$1.flipBackslashes && isWin32 && str.indexOf(slash$1) < 0) str = str.replace(backslash, slash$1);
|
15194
|
+
if (enclosure.test(str)) str += slash$1;
|
15162
15195
|
str += "a";
|
15163
15196
|
do
|
15164
15197
|
str = pathPosixDirname(str);
|
@@ -15495,7 +15528,7 @@ var require_to_regex_range = __commonJS({ "../../node_modules/.pnpm/to-regex-ran
|
|
15495
15528
|
var require_fill_range = __commonJS({ "../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js"(exports, module) {
|
15496
15529
|
const util$1 = require("util");
|
15497
15530
|
const toRegexRange = require_to_regex_range();
|
15498
|
-
const isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
15531
|
+
const isObject$1 = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
15499
15532
|
const transform$1 = (toNumber) => {
|
15500
15533
|
return (value$1) => toNumber === true ? Number(value$1) : String(value$1);
|
15501
15534
|
};
|
@@ -15640,12 +15673,12 @@ var require_fill_range = __commonJS({ "../../node_modules/.pnpm/fill-range@7.1.1
|
|
15640
15673
|
if (end == null && isValidValue(start)) return [start];
|
15641
15674
|
if (!isValidValue(start) || !isValidValue(end)) return invalidRange(start, end, options$1);
|
15642
15675
|
if (typeof step === "function") return fill$2(start, end, 1, { transform: step });
|
15643
|
-
if (isObject(step)) return fill$2(start, end, 0, step);
|
15676
|
+
if (isObject$1(step)) return fill$2(start, end, 0, step);
|
15644
15677
|
let opts = { ...options$1 };
|
15645
15678
|
if (opts.capture === true) opts.wrap = true;
|
15646
15679
|
step = step || opts.step || 1;
|
15647
15680
|
if (!isNumber(step)) {
|
15648
|
-
if (step != null && !isObject(step)) return invalidStep(step, opts);
|
15681
|
+
if (step != null && !isObject$1(step)) return invalidStep(step, opts);
|
15649
15682
|
return fill$2(start, end, 1, step);
|
15650
15683
|
}
|
15651
15684
|
if (isNumber(start) && isNumber(end)) return fillNumbers(start, end, step, opts);
|
@@ -15833,7 +15866,7 @@ var require_parse$2 = __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_m
|
|
15833
15866
|
/**
|
15834
15867
|
* parse
|
15835
15868
|
*/
|
15836
|
-
const parse$
|
15869
|
+
const parse$8 = (input, options$1 = {}) => {
|
15837
15870
|
if (typeof input !== "string") throw new TypeError("Expected a string");
|
15838
15871
|
const opts = options$1 || {};
|
15839
15872
|
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
@@ -16109,7 +16142,7 @@ var require_parse$2 = __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_m
|
|
16109
16142
|
push$1({ type: "eos" });
|
16110
16143
|
return ast;
|
16111
16144
|
};
|
16112
|
-
module.exports = parse$
|
16145
|
+
module.exports = parse$8;
|
16113
16146
|
} });
|
16114
16147
|
|
16115
16148
|
//#endregion
|
@@ -16118,7 +16151,7 @@ var require_braces = __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_mo
|
|
16118
16151
|
const stringify = require_stringify();
|
16119
16152
|
const compile = require_compile();
|
16120
16153
|
const expand = require_expand();
|
16121
|
-
const parse$
|
16154
|
+
const parse$7 = require_parse$2();
|
16122
16155
|
/**
|
16123
16156
|
* Expand the given pattern or create a regex-compatible string.
|
16124
16157
|
*
|
@@ -16156,7 +16189,7 @@ var require_braces = __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_mo
|
|
16156
16189
|
* @return {Object} Returns an AST
|
16157
16190
|
* @api public
|
16158
16191
|
*/
|
16159
|
-
braces$1.parse = (input, options$1 = {}) => parse$
|
16192
|
+
braces$1.parse = (input, options$1 = {}) => parse$7(input, options$1);
|
16160
16193
|
/**
|
16161
16194
|
* Creates a braces string from an AST, or an AST node.
|
16162
16195
|
*
|
@@ -16595,7 +16628,7 @@ var require_nodefs_handler = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6
|
|
16595
16628
|
const sysPath$2 = require("path");
|
16596
16629
|
const { promisify: promisify$3 } = require("util");
|
16597
16630
|
const isBinaryPath = require_is_binary_path();
|
16598
|
-
const { isWindows: isWindows$
|
16631
|
+
const { isWindows: isWindows$3, isLinux, EMPTY_FN: EMPTY_FN$2, EMPTY_STR: EMPTY_STR$1, KEY_LISTENERS, KEY_ERR, KEY_RAW, HANDLER_KEYS, EV_CHANGE: EV_CHANGE$2, EV_ADD: EV_ADD$2, EV_ADD_DIR: EV_ADD_DIR$2, EV_ERROR: EV_ERROR$2, STR_DATA: STR_DATA$1, STR_END: STR_END$2, BRACE_START: BRACE_START$1, STAR } = require_constants$2();
|
16599
16632
|
const THROTTLE_MODE_WATCH = "watch";
|
16600
16633
|
const open$1 = promisify$3(fs$9.open);
|
16601
16634
|
const stat$2 = promisify$3(fs$9.stat);
|
@@ -16640,7 +16673,7 @@ var require_nodefs_handler = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6
|
|
16640
16673
|
/**
|
16641
16674
|
* @type {Map<String,FsWatchContainer>}
|
16642
16675
|
*/
|
16643
|
-
const FsWatchInstances = new Map();
|
16676
|
+
const FsWatchInstances = /* @__PURE__ */ new Map();
|
16644
16677
|
/**
|
16645
16678
|
* Instantiates the fs_watch interface
|
16646
16679
|
* @param {String} path to be watched
|
@@ -16704,7 +16737,7 @@ var require_nodefs_handler = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6
|
|
16704
16737
|
watcher.on(EV_ERROR$2, async (error$1) => {
|
16705
16738
|
const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
|
16706
16739
|
cont.watcherUnusable = true;
|
16707
|
-
if (isWindows$
|
16740
|
+
if (isWindows$3 && error$1.code === "EPERM") try {
|
16708
16741
|
const fd$1 = await open$1(path$13, "r");
|
16709
16742
|
await close(fd$1);
|
16710
16743
|
broadcastErr(error$1);
|
@@ -16732,7 +16765,7 @@ var require_nodefs_handler = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6
|
|
16732
16765
|
}
|
16733
16766
|
};
|
16734
16767
|
};
|
16735
|
-
const FsWatchFileInstances = new Map();
|
16768
|
+
const FsWatchFileInstances = /* @__PURE__ */ new Map();
|
16736
16769
|
/**
|
16737
16770
|
* Instantiates the fs_watchFile interface or binds listeners
|
16738
16771
|
* to an existing one covering the same file system entry
|
@@ -16745,8 +16778,8 @@ var require_nodefs_handler = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6
|
|
16745
16778
|
const setFsWatchFileListener = (path$13, fullPath, options$1, handlers) => {
|
16746
16779
|
const { listener: listener$1, rawEmitter } = handlers;
|
16747
16780
|
let cont = FsWatchFileInstances.get(fullPath);
|
16748
|
-
let listeners = new Set();
|
16749
|
-
let rawEmitters = new Set();
|
16781
|
+
let listeners = /* @__PURE__ */ new Set();
|
16782
|
+
let rawEmitters = /* @__PURE__ */ new Set();
|
16750
16783
|
const copts = cont && cont.options;
|
16751
16784
|
if (copts && (copts.persistent < options$1.persistent || copts.interval > options$1.interval)) {
|
16752
16785
|
listeners = cont.listeners;
|
@@ -16915,7 +16948,7 @@ var require_nodefs_handler = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6
|
|
16915
16948
|
if (!throttler) return;
|
16916
16949
|
}
|
16917
16950
|
const previous = this.fsw._getWatchedDir(wh.path);
|
16918
|
-
const current = new Set();
|
16951
|
+
const current = /* @__PURE__ */ new Set();
|
16919
16952
|
let stream$1 = this.fsw._readdirp(directory, {
|
16920
16953
|
fileFilter: (entry) => wh.filterPath(entry),
|
16921
16954
|
directoryFilter: (entry) => wh.filterDir(entry),
|
@@ -17094,7 +17127,7 @@ var require_fsevents_handler = __commonJS({ "../../node_modules/.pnpm/chokidar@3
|
|
17094
17127
|
* Object to hold per-process fsevents instances (may be shared across chokidar FSWatcher instances)
|
17095
17128
|
* @type {Map<Path,FsEventsWatchContainer>}
|
17096
17129
|
*/
|
17097
|
-
const FSEventsWatchers = new Map();
|
17130
|
+
const FSEventsWatchers = /* @__PURE__ */ new Map();
|
17098
17131
|
const consolidateThreshhold = 10;
|
17099
17132
|
const wrongEventFlags = new Set([
|
17100
17133
|
69888,
|
@@ -17403,10 +17436,10 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17403
17436
|
const globParent = require_glob_parent();
|
17404
17437
|
const isGlob = require_is_glob();
|
17405
17438
|
const braces = require_braces();
|
17406
|
-
const normalizePath = require_normalize_path();
|
17439
|
+
const normalizePath$1 = require_normalize_path();
|
17407
17440
|
const NodeFsHandler = require_nodefs_handler();
|
17408
17441
|
const FsEventsHandler = require_fsevents_handler();
|
17409
|
-
const { EV_ALL, EV_READY, EV_ADD, EV_CHANGE, EV_UNLINK, EV_ADD_DIR, EV_UNLINK_DIR, EV_RAW, EV_ERROR, STR_CLOSE, STR_END, BACK_SLASH_RE, DOUBLE_SLASH_RE, SLASH_OR_BACK_SLASH_RE, DOT_RE, REPLACER_RE, SLASH, SLASH_SLASH, BRACE_START, BANG, ONE_DOT, TWO_DOTS, GLOBSTAR, SLASH_GLOBSTAR, ANYMATCH_OPTS, STRING_TYPE, FUNCTION_TYPE, EMPTY_STR, EMPTY_FN, isWindows: isWindows$
|
17442
|
+
const { EV_ALL, EV_READY, EV_ADD, EV_CHANGE, EV_UNLINK, EV_ADD_DIR, EV_UNLINK_DIR, EV_RAW, EV_ERROR, STR_CLOSE, STR_END, BACK_SLASH_RE, DOUBLE_SLASH_RE, SLASH_OR_BACK_SLASH_RE, DOT_RE, REPLACER_RE, SLASH, SLASH_SLASH, BRACE_START, BANG, ONE_DOT, TWO_DOTS, GLOBSTAR, SLASH_GLOBSTAR, ANYMATCH_OPTS, STRING_TYPE, FUNCTION_TYPE, EMPTY_STR, EMPTY_FN, isWindows: isWindows$2, isMacos, isIBMi } = require_constants$2();
|
17410
17443
|
const stat = promisify$1(fs$7.stat);
|
17411
17444
|
const readdir = promisify$1(fs$7.readdir);
|
17412
17445
|
/**
|
@@ -17476,7 +17509,7 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17476
17509
|
this.path = dir;
|
17477
17510
|
this._removeWatcher = removeWatcher;
|
17478
17511
|
/** @type {Set<Path>} */
|
17479
|
-
this.items = new Set();
|
17512
|
+
this.items = /* @__PURE__ */ new Set();
|
17480
17513
|
}
|
17481
17514
|
add(item) {
|
17482
17515
|
const { items } = this;
|
@@ -17591,16 +17624,16 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17591
17624
|
const opts = {};
|
17592
17625
|
if (_opts) Object.assign(opts, _opts);
|
17593
17626
|
/** @type {Map<String, DirEntry>} */
|
17594
|
-
this._watched = new Map();
|
17627
|
+
this._watched = /* @__PURE__ */ new Map();
|
17595
17628
|
/** @type {Map<String, Array>} */
|
17596
|
-
this._closers = new Map();
|
17629
|
+
this._closers = /* @__PURE__ */ new Map();
|
17597
17630
|
/** @type {Set<String>} */
|
17598
|
-
this._ignoredPaths = new Set();
|
17631
|
+
this._ignoredPaths = /* @__PURE__ */ new Set();
|
17599
17632
|
/** @type {Map<ThrottleType, Map>} */
|
17600
|
-
this._throttled = new Map();
|
17633
|
+
this._throttled = /* @__PURE__ */ new Map();
|
17601
17634
|
/** @type {Map<Path, String|Boolean>} */
|
17602
|
-
this._symlinkPaths = new Map();
|
17603
|
-
this._streams = new Set();
|
17635
|
+
this._symlinkPaths = /* @__PURE__ */ new Map();
|
17636
|
+
this._streams = /* @__PURE__ */ new Set();
|
17604
17637
|
this.closed = false;
|
17605
17638
|
if (undef(opts, "persistent")) opts.persistent = true;
|
17606
17639
|
if (undef(opts, "ignoreInitial")) opts.ignoreInitial = false;
|
@@ -17624,7 +17657,7 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17624
17657
|
const envInterval = process.env.CHOKIDAR_INTERVAL;
|
17625
17658
|
if (envInterval) opts.interval = Number.parseInt(envInterval, 10);
|
17626
17659
|
if (undef(opts, "atomic")) opts.atomic = !opts.usePolling && !opts.useFsEvents;
|
17627
|
-
if (opts.atomic) this._pendingUnlinks = new Map();
|
17660
|
+
if (opts.atomic) this._pendingUnlinks = /* @__PURE__ */ new Map();
|
17628
17661
|
if (undef(opts, "followSymlinks")) opts.followSymlinks = true;
|
17629
17662
|
if (undef(opts, "awaitWriteFinish")) opts.awaitWriteFinish = false;
|
17630
17663
|
if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {};
|
@@ -17632,7 +17665,7 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17632
17665
|
if (awf) {
|
17633
17666
|
if (!awf.stabilityThreshold) awf.stabilityThreshold = 2e3;
|
17634
17667
|
if (!awf.pollInterval) awf.pollInterval = 100;
|
17635
|
-
this._pendingWrites = new Map();
|
17668
|
+
this._pendingWrites = /* @__PURE__ */ new Map();
|
17636
17669
|
}
|
17637
17670
|
if (opts.ignored) opts.ignored = arrify(opts.ignored);
|
17638
17671
|
let readyCalls = 0;
|
@@ -17665,7 +17698,7 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17665
17698
|
if (cwd) paths = paths.map((path$13) => {
|
17666
17699
|
const absPath = getAbsolutePath(path$13, cwd);
|
17667
17700
|
if (disableGlobbing || !isGlob(path$13)) return absPath;
|
17668
|
-
return normalizePath(absPath);
|
17701
|
+
return normalizePath$1(absPath);
|
17669
17702
|
});
|
17670
17703
|
paths = paths.filter((path$13) => {
|
17671
17704
|
if (path$13.startsWith(BANG)) {
|
@@ -17777,7 +17810,7 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17777
17810
|
async _emit(event, path$13, val1, val2, val3) {
|
17778
17811
|
if (this.closed) return;
|
17779
17812
|
const opts = this.options;
|
17780
|
-
if (isWindows$
|
17813
|
+
if (isWindows$2) path$13 = sysPath.normalize(path$13);
|
17781
17814
|
if (opts.cwd) path$13 = sysPath.relative(opts.cwd, path$13);
|
17782
17815
|
/** @type Array<any> */
|
17783
17816
|
const args = [event, path$13];
|
@@ -17787,7 +17820,7 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17787
17820
|
const awf = opts.awaitWriteFinish;
|
17788
17821
|
let pw;
|
17789
17822
|
if (awf && (pw = this._pendingWrites.get(path$13))) {
|
17790
|
-
pw.lastChange = new Date();
|
17823
|
+
pw.lastChange = /* @__PURE__ */ new Date();
|
17791
17824
|
return this;
|
17792
17825
|
}
|
17793
17826
|
if (opts.atomic) {
|
@@ -17856,7 +17889,7 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17856
17889
|
* @returns {Object|false} tracking object or false if action should be suppressed
|
17857
17890
|
*/
|
17858
17891
|
_throttle(actionType, path$13, timeout) {
|
17859
|
-
if (!this._throttled.has(actionType)) this._throttled.set(actionType, new Map());
|
17892
|
+
if (!this._throttled.has(actionType)) this._throttled.set(actionType, /* @__PURE__ */ new Map());
|
17860
17893
|
/** @type {Map<Path, Object>} */
|
17861
17894
|
const action = this._throttled.get(actionType);
|
17862
17895
|
/** @type {Object} */
|
@@ -17898,14 +17931,14 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17898
17931
|
let timeoutHandler;
|
17899
17932
|
let fullPath = path$13;
|
17900
17933
|
if (this.options.cwd && !sysPath.isAbsolute(path$13)) fullPath = sysPath.join(this.options.cwd, path$13);
|
17901
|
-
const now = new Date();
|
17934
|
+
const now = /* @__PURE__ */ new Date();
|
17902
17935
|
const awaitWriteFinish = (prevStat) => {
|
17903
17936
|
fs$7.stat(fullPath, (err$2, curStat) => {
|
17904
17937
|
if (err$2 || !this._pendingWrites.has(path$13)) {
|
17905
17938
|
if (err$2 && err$2.code !== "ENOENT") awfEmit(err$2);
|
17906
17939
|
return;
|
17907
17940
|
}
|
17908
|
-
const now$1 = Number(new Date());
|
17941
|
+
const now$1 = Number(/* @__PURE__ */ new Date());
|
17909
17942
|
if (prevStat && curStat.size !== prevStat.size) this._pendingWrites.get(path$13).lastChange = now$1;
|
17910
17943
|
const pw = this._pendingWrites.get(path$13);
|
17911
17944
|
const df = now$1 - pw.lastChange;
|
@@ -18620,7 +18653,7 @@ var require_launch_editor_middleware = __commonJS({ "../../node_modules/.pnpm/la
|
|
18620
18653
|
|
18621
18654
|
//#endregion
|
18622
18655
|
//#region src/node/http.ts
|
18623
|
-
var import_picocolors$20 = __toESM(require_picocolors()
|
18656
|
+
var import_picocolors$20 = __toESM(require_picocolors());
|
18624
18657
|
async function resolveHttpServer({ proxy }, app, httpsOptions) {
|
18625
18658
|
if (!httpsOptions) {
|
18626
18659
|
const { createServer: createServer$4 } = await import("node:http");
|
@@ -18714,7 +18747,7 @@ function ssrRewriteStacktrace(stack, moduleGraph) {
|
|
18714
18747
|
const rawSourceMap = mod?.transformResult?.map;
|
18715
18748
|
if (!rawSourceMap) return input;
|
18716
18749
|
const traced = new TraceMap(rawSourceMap);
|
18717
|
-
const pos = originalPositionFor
|
18750
|
+
const pos = originalPositionFor(traced, {
|
18718
18751
|
line: Number(line$1) - offset,
|
18719
18752
|
column: Number(column) - 1
|
18720
18753
|
});
|
@@ -18737,7 +18770,7 @@ function rebindErrorStacktrace(e$1, stacktrace) {
|
|
18737
18770
|
});
|
18738
18771
|
else if (writable) e$1.stack = stacktrace;
|
18739
18772
|
}
|
18740
|
-
const rewroteStacktraces = new WeakSet();
|
18773
|
+
const rewroteStacktraces = /* @__PURE__ */ new WeakSet();
|
18741
18774
|
function ssrFixStacktrace(e$1, moduleGraph) {
|
18742
18775
|
if (!e$1.stack) return;
|
18743
18776
|
if (rewroteStacktraces.has(e$1)) return;
|
@@ -18805,11 +18838,11 @@ function createServerModuleRunner(environment, options$1 = {}) {
|
|
18805
18838
|
|
18806
18839
|
//#endregion
|
18807
18840
|
//#region src/node/ssr/ssrModuleLoader.ts
|
18808
|
-
var import_picocolors$19 = __toESM(require_picocolors()
|
18841
|
+
var import_picocolors$19 = __toESM(require_picocolors());
|
18809
18842
|
async function ssrLoadModule(url$6, server, fixStacktrace) {
|
18810
18843
|
const environment = server.environments.ssr;
|
18811
18844
|
server._ssrCompatModuleRunner ||= new SSRCompatModuleRunner(environment);
|
18812
|
-
url$6 = unwrapId
|
18845
|
+
url$6 = unwrapId(url$6);
|
18813
18846
|
return instantiateModule(url$6, server._ssrCompatModuleRunner, environment, fixStacktrace);
|
18814
18847
|
}
|
18815
18848
|
async function instantiateModule(url$6, runner, environment, fixStacktrace) {
|
@@ -19075,7 +19108,7 @@ function isNode(value$1) {
|
|
19075
19108
|
* }} walker
|
19076
19109
|
* @returns {Node | null}
|
19077
19110
|
*/
|
19078
|
-
function walk
|
19111
|
+
function walk(ast, { enter, leave }) {
|
19079
19112
|
const instance = new SyncWalker(enter, leave);
|
19080
19113
|
return instance.visit(ast, null);
|
19081
19114
|
}
|
@@ -19086,6 +19119,7 @@ const ssrModuleExportsKey = `__vite_ssr_exports__`;
|
|
19086
19119
|
const ssrImportKey = `__vite_ssr_import__`;
|
19087
19120
|
const ssrDynamicImportKey = `__vite_ssr_dynamic_import__`;
|
19088
19121
|
const ssrExportAllKey = `__vite_ssr_exportAll__`;
|
19122
|
+
const ssrExportNameKey = `__vite_ssr_exportName__`;
|
19089
19123
|
const ssrImportMetaKey = `__vite_ssr_import_meta__`;
|
19090
19124
|
const hashbangRE = /^#!.*\n/;
|
19091
19125
|
async function ssrTransform(code, inMap, url$6, originalCode, options$1) {
|
@@ -19120,10 +19154,10 @@ async function ssrTransformScript(code, inMap, url$6, originalCode) {
|
|
19120
19154
|
throw err$2;
|
19121
19155
|
}
|
19122
19156
|
let uid = 0;
|
19123
|
-
const deps = new Set();
|
19124
|
-
const dynamicDeps = new Set();
|
19125
|
-
const idToImportMap = new Map();
|
19126
|
-
const declaredConst = new Set();
|
19157
|
+
const deps = /* @__PURE__ */ new Set();
|
19158
|
+
const dynamicDeps = /* @__PURE__ */ new Set();
|
19159
|
+
const idToImportMap = /* @__PURE__ */ new Map();
|
19160
|
+
const declaredConst = /* @__PURE__ */ new Set();
|
19127
19161
|
const fileStartIndex = hashbangRE.exec(code)?.[0].length ?? 0;
|
19128
19162
|
let hoistIndex = fileStartIndex;
|
19129
19163
|
function defineImport(index, importNode, metadata) {
|
@@ -19138,11 +19172,11 @@ async function ssrTransformScript(code, inMap, url$6, originalCode) {
|
|
19138
19172
|
return importId;
|
19139
19173
|
}
|
19140
19174
|
function defineExport(name, local = name) {
|
19141
|
-
s$2.appendLeft(fileStartIndex,
|
19175
|
+
s$2.appendLeft(fileStartIndex, `${ssrExportNameKey}(${JSON.stringify(name)}, () => { try { return ${local} } catch {} });\n`);
|
19142
19176
|
}
|
19143
19177
|
const imports = [];
|
19144
19178
|
const exports$1 = [];
|
19145
|
-
const reExportImportIdMap = new Map();
|
19179
|
+
const reExportImportIdMap = /* @__PURE__ */ new Map();
|
19146
19180
|
for (const node of ast.body) if (node.type === "ImportDeclaration") imports.push(node);
|
19147
19181
|
else if (node.type === "ExportDefaultDeclaration") exports$1.push(node);
|
19148
19182
|
else if (node.type === "ExportNamedDeclaration" || node.type === "ExportAllDeclaration") {
|
@@ -19217,7 +19251,7 @@ async function ssrTransformScript(code, inMap, url$6, originalCode) {
|
|
19217
19251
|
} else s$2.appendLeft(node.end, `${ssrExportAllKey}(${importId});\n`);
|
19218
19252
|
}
|
19219
19253
|
}
|
19220
|
-
walk(ast, {
|
19254
|
+
walk$1(ast, {
|
19221
19255
|
onStatements(statements) {
|
19222
19256
|
for (let i$1 = 0; i$1 < statements.length - 1; i$1++) {
|
19223
19257
|
const stmt = statements[i$1];
|
@@ -19269,23 +19303,23 @@ async function ssrTransformScript(code, inMap, url$6, originalCode) {
|
|
19269
19303
|
function getIdentifierNameOrLiteralValue$1(node) {
|
19270
19304
|
return node.type === "Identifier" ? node.name : node.value;
|
19271
19305
|
}
|
19272
|
-
const isNodeInPatternWeakSet = new WeakSet();
|
19306
|
+
const isNodeInPatternWeakSet = /* @__PURE__ */ new WeakSet();
|
19273
19307
|
const setIsNodeInPattern = (node) => isNodeInPatternWeakSet.add(node);
|
19274
19308
|
const isNodeInPattern = (node) => isNodeInPatternWeakSet.has(node);
|
19275
19309
|
/**
|
19276
19310
|
* Same logic from \@vue/compiler-core & \@vue/compiler-sfc
|
19277
19311
|
* Except this is using acorn AST
|
19278
19312
|
*/
|
19279
|
-
function walk(root, { onIdentifier, onImportMeta, onDynamicImport, onStatements }) {
|
19313
|
+
function walk$1(root, { onIdentifier, onImportMeta, onDynamicImport, onStatements }) {
|
19280
19314
|
const parentStack = [];
|
19281
19315
|
const varKindStack = [];
|
19282
|
-
const scopeMap = new WeakMap();
|
19316
|
+
const scopeMap = /* @__PURE__ */ new WeakMap();
|
19283
19317
|
const identifiers = [];
|
19284
19318
|
const setScope = (node, name) => {
|
19285
19319
|
let scopeIds = scopeMap.get(node);
|
19286
19320
|
if (scopeIds && scopeIds.has(name)) return;
|
19287
19321
|
if (!scopeIds) {
|
19288
|
-
scopeIds = new Set();
|
19322
|
+
scopeIds = /* @__PURE__ */ new Set();
|
19289
19323
|
scopeMap.set(node, scopeIds);
|
19290
19324
|
}
|
19291
19325
|
scopeIds.add(name);
|
@@ -19306,7 +19340,7 @@ function walk(root, { onIdentifier, onImportMeta, onDynamicImport, onStatements
|
|
19306
19340
|
else if (p$1.type === "AssignmentPattern") handlePattern(p$1.left, parentScope);
|
19307
19341
|
else setScope(parentScope, p$1.name);
|
19308
19342
|
}
|
19309
|
-
walk
|
19343
|
+
walk(root, {
|
19310
19344
|
enter(node, parent) {
|
19311
19345
|
if (node.type === "ImportDeclaration") return this.skip();
|
19312
19346
|
if (node.type === "Program" || node.type === "BlockStatement" || node.type === "StaticBlock") onStatements(node.body);
|
@@ -19328,7 +19362,7 @@ function walk(root, { onIdentifier, onImportMeta, onDynamicImport, onStatements
|
|
19328
19362
|
handlePattern(p$1, node);
|
19329
19363
|
return;
|
19330
19364
|
}
|
19331
|
-
walk
|
19365
|
+
walk(p$1.type === "AssignmentPattern" ? p$1.left : p$1, { enter(child, parent$1) {
|
19332
19366
|
if (parent$1?.type === "AssignmentPattern" && parent$1.right === child) return this.skip();
|
19333
19367
|
if (child.type !== "Identifier") return;
|
19334
19368
|
if (isStaticPropertyKey(child, parent$1)) return;
|
@@ -19925,17 +19959,17 @@ var require_isexe = __commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modu
|
|
19925
19959
|
//#endregion
|
19926
19960
|
//#region ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
|
19927
19961
|
var require_which = __commonJS({ "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module) {
|
19928
|
-
const isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
19962
|
+
const isWindows$1 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
19929
19963
|
const path$4 = require("path");
|
19930
|
-
const COLON = isWindows ? ";" : ":";
|
19964
|
+
const COLON = isWindows$1 ? ";" : ":";
|
19931
19965
|
const isexe = require_isexe();
|
19932
19966
|
const getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
19933
19967
|
const getPathInfo = (cmd, opt) => {
|
19934
19968
|
const colon = opt.colon || COLON;
|
19935
|
-
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [...isWindows ? [process.cwd()] : [], ...(opt.path || process.env.PATH || "").split(colon)];
|
19936
|
-
const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
19937
|
-
const pathExt = isWindows ? pathExtExe.split(colon) : [""];
|
19938
|
-
if (isWindows) {
|
19969
|
+
const pathEnv = cmd.match(/\//) || isWindows$1 && cmd.match(/\\/) ? [""] : [...isWindows$1 ? [process.cwd()] : [], ...(opt.path || process.env.PATH || "").split(colon)];
|
19970
|
+
const pathExtExe = isWindows$1 ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
19971
|
+
const pathExt = isWindows$1 ? pathExtExe.split(colon) : [""];
|
19972
|
+
if (isWindows$1) {
|
19939
19973
|
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "") pathExt.unshift("");
|
19940
19974
|
}
|
19941
19975
|
return {
|
@@ -20143,7 +20177,7 @@ var require_parse = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/nod
|
|
20143
20177
|
}
|
20144
20178
|
return parsed;
|
20145
20179
|
}
|
20146
|
-
function parse$
|
20180
|
+
function parse$6(command, args, options$1) {
|
20147
20181
|
if (args && !Array.isArray(args)) {
|
20148
20182
|
options$1 = args;
|
20149
20183
|
args = null;
|
@@ -20162,7 +20196,7 @@ var require_parse = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/nod
|
|
20162
20196
|
};
|
20163
20197
|
return options$1.shell ? parsed : parseNonShell(parsed);
|
20164
20198
|
}
|
20165
|
-
module.exports = parse$
|
20199
|
+
module.exports = parse$6;
|
20166
20200
|
} });
|
20167
20201
|
|
20168
20202
|
//#endregion
|
@@ -20209,16 +20243,16 @@ var require_enoent = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/no
|
|
20209
20243
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
|
20210
20244
|
var require_cross_spawn = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports, module) {
|
20211
20245
|
const cp = require("child_process");
|
20212
|
-
const parse$
|
20246
|
+
const parse$5 = require_parse();
|
20213
20247
|
const enoent = require_enoent();
|
20214
20248
|
function spawn$1(command, args, options$1) {
|
20215
|
-
const parsed = parse$
|
20249
|
+
const parsed = parse$5(command, args, options$1);
|
20216
20250
|
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
20217
20251
|
enoent.hookChildProcess(spawned, parsed);
|
20218
20252
|
return spawned;
|
20219
20253
|
}
|
20220
20254
|
function spawnSync(command, args, options$1) {
|
20221
|
-
const parsed = parse$
|
20255
|
+
const parsed = parse$5(command, args, options$1);
|
20222
20256
|
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
20223
20257
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
20224
20258
|
return result;
|
@@ -20226,14 +20260,14 @@ var require_cross_spawn = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0
|
|
20226
20260
|
module.exports = spawn$1;
|
20227
20261
|
module.exports.spawn = spawn$1;
|
20228
20262
|
module.exports.sync = spawnSync;
|
20229
|
-
module.exports._parse = parse$
|
20263
|
+
module.exports._parse = parse$5;
|
20230
20264
|
module.exports._enoent = enoent;
|
20231
20265
|
} });
|
20232
20266
|
|
20233
20267
|
//#endregion
|
20234
20268
|
//#region src/node/server/openBrowser.ts
|
20235
|
-
var import_cross_spawn = __toESM(require_cross_spawn()
|
20236
|
-
var import_picocolors$18 = __toESM(require_picocolors()
|
20269
|
+
var import_cross_spawn = __toESM(require_cross_spawn());
|
20270
|
+
var import_picocolors$18 = __toESM(require_picocolors());
|
20237
20271
|
/**
|
20238
20272
|
* Reads the BROWSER environment variable and decides what to do with it.
|
20239
20273
|
*/
|
@@ -20306,7 +20340,7 @@ function execAsync(command, options$1) {
|
|
20306
20340
|
|
20307
20341
|
//#endregion
|
20308
20342
|
//#region src/node/shortcuts.ts
|
20309
|
-
var import_picocolors$17 = __toESM(require_picocolors()
|
20343
|
+
var import_picocolors$17 = __toESM(require_picocolors());
|
20310
20344
|
function bindCLIShortcuts(server, opts) {
|
20311
20345
|
if (!server.httpServer || !process.stdin.isTTY || process.env.CI) return;
|
20312
20346
|
const isDev = isDevServer(server);
|
@@ -20317,7 +20351,7 @@ function bindCLIShortcuts(server, opts) {
|
|
20317
20351
|
const onInput = async (input) => {
|
20318
20352
|
if (actionRunning) return;
|
20319
20353
|
if (input === "h") {
|
20320
|
-
const loggedKeys = new Set();
|
20354
|
+
const loggedKeys = /* @__PURE__ */ new Set();
|
20321
20355
|
server.config.logger.info("\n Shortcuts");
|
20322
20356
|
for (const shortcut$1 of shortcuts) {
|
20323
20357
|
if (loggedKeys.has(shortcut$1.key)) continue;
|
@@ -20401,7 +20435,7 @@ const BASE_PREVIEW_SHORTCUTS = [{
|
|
20401
20435
|
|
20402
20436
|
//#endregion
|
20403
20437
|
//#region src/node/watch.ts
|
20404
|
-
var import_picocolors$16 = __toESM(require_picocolors()
|
20438
|
+
var import_picocolors$16 = __toESM(require_picocolors());
|
20405
20439
|
function getResolvedOutDirs(root, outDir, outputOptions) {
|
20406
20440
|
const resolvedOutDir = path.resolve(root, outDir);
|
20407
20441
|
if (!outputOptions) return new Set([resolvedOutDir]);
|
@@ -20409,7 +20443,7 @@ function getResolvedOutDirs(root, outDir, outputOptions) {
|
|
20409
20443
|
}
|
20410
20444
|
function resolveEmptyOutDir(emptyOutDir, root, outDirs, logger) {
|
20411
20445
|
if (emptyOutDir != null) return emptyOutDir;
|
20412
|
-
for (const outDir of outDirs) if (!normalizePath
|
20446
|
+
for (const outDir of outDirs) if (!normalizePath(outDir).startsWith(withTrailingSlash(root))) {
|
20413
20447
|
logger?.warn(import_picocolors$16.default.yellow(`\n${import_picocolors$16.default.bold(`(!)`)} outDir ${import_picocolors$16.default.white(import_picocolors$16.default.dim(outDir))} is not inside project root and will not be emptied.\nUse --emptyOutDir to override.\n`));
|
20414
20448
|
return false;
|
20415
20449
|
}
|
@@ -22377,7 +22411,7 @@ var require_extension = __commonJS({ "../../node_modules/.pnpm/ws@8.18.2/node_mo
|
|
22377
22411
|
* @return {Object} The parsed object
|
22378
22412
|
* @public
|
22379
22413
|
*/
|
22380
|
-
function parse$
|
22414
|
+
function parse$4(header) {
|
22381
22415
|
const offers = Object.create(null);
|
22382
22416
|
let params = Object.create(null);
|
22383
22417
|
let mustUnescape = false;
|
@@ -22492,7 +22526,7 @@ var require_extension = __commonJS({ "../../node_modules/.pnpm/ws@8.18.2/node_mo
|
|
22492
22526
|
}
|
22493
22527
|
module.exports = {
|
22494
22528
|
format: format$2,
|
22495
|
-
parse: parse$
|
22529
|
+
parse: parse$4
|
22496
22530
|
};
|
22497
22531
|
} });
|
22498
22532
|
|
@@ -22513,7 +22547,7 @@ var require_websocket = __commonJS({ "../../node_modules/.pnpm/ws@8.18.2/node_mo
|
|
22513
22547
|
const { isBlob } = require_validation();
|
22514
22548
|
const { BINARY_TYPES, EMPTY_BUFFER, GUID: GUID$1, kForOnEventAttribute, kListener, kStatusCode, kWebSocket: kWebSocket$1, NOOP: NOOP$1 } = require_constants$1();
|
22515
22549
|
const { EventTarget: { addEventListener, removeEventListener } } = require_event_target();
|
22516
|
-
const { format: format$1, parse: parse$
|
22550
|
+
const { format: format$1, parse: parse$3 } = require_extension();
|
22517
22551
|
const { toBuffer } = require_buffer_util();
|
22518
22552
|
const closeTimeout = 30 * 1e3;
|
22519
22553
|
const kAborted = Symbol("kAborted");
|
@@ -23059,7 +23093,7 @@ var require_websocket = __commonJS({ "../../node_modules/.pnpm/ws@8.18.2/node_mo
|
|
23059
23093
|
const defaultPort = isSecure ? 443 : 80;
|
23060
23094
|
const key = randomBytes(16).toString("base64");
|
23061
23095
|
const request = isSecure ? https$3.request : http$4.request;
|
23062
|
-
const protocolSet = new Set();
|
23096
|
+
const protocolSet = /* @__PURE__ */ new Set();
|
23063
23097
|
let perMessageDeflate;
|
23064
23098
|
opts.createConnection = opts.createConnection || (isSecure ? tlsConnect : netConnect);
|
23065
23099
|
opts.defaultPort = opts.defaultPort || defaultPort;
|
@@ -23180,7 +23214,7 @@ var require_websocket = __commonJS({ "../../node_modules/.pnpm/ws@8.18.2/node_mo
|
|
23180
23214
|
}
|
23181
23215
|
let extensions$1;
|
23182
23216
|
try {
|
23183
|
-
extensions$1 = parse$
|
23217
|
+
extensions$1 = parse$3(secWebSocketExtensions);
|
23184
23218
|
} catch (err$2) {
|
23185
23219
|
const message = "Invalid Sec-WebSocket-Extensions header";
|
23186
23220
|
abortHandshake$1(websocket, socket, message);
|
@@ -23597,8 +23631,8 @@ var require_subprotocol = __commonJS({ "../../node_modules/.pnpm/ws@8.18.2/node_
|
|
23597
23631
|
* @return {Set} The subprotocol names
|
23598
23632
|
* @public
|
23599
23633
|
*/
|
23600
|
-
function parse$
|
23601
|
-
const protocols = new Set();
|
23634
|
+
function parse$2(header) {
|
23635
|
+
const protocols = /* @__PURE__ */ new Set();
|
23602
23636
|
let start = -1;
|
23603
23637
|
let end = -1;
|
23604
23638
|
let i$1 = 0;
|
@@ -23623,7 +23657,7 @@ var require_subprotocol = __commonJS({ "../../node_modules/.pnpm/ws@8.18.2/node_
|
|
23623
23657
|
protocols.add(protocol);
|
23624
23658
|
return protocols;
|
23625
23659
|
}
|
23626
|
-
module.exports = { parse: parse$
|
23660
|
+
module.exports = { parse: parse$2 };
|
23627
23661
|
} });
|
23628
23662
|
|
23629
23663
|
//#endregion
|
@@ -23723,7 +23757,7 @@ var require_websocket_server = __commonJS({ "../../node_modules/.pnpm/ws@8.18.2/
|
|
23723
23757
|
}
|
23724
23758
|
if (options$1.perMessageDeflate === true) options$1.perMessageDeflate = {};
|
23725
23759
|
if (options$1.clientTracking) {
|
23726
|
-
this.clients = new Set();
|
23760
|
+
this.clients = /* @__PURE__ */ new Set();
|
23727
23761
|
this._shouldEmitClose = false;
|
23728
23762
|
}
|
23729
23763
|
this.options = options$1;
|
@@ -23832,7 +23866,7 @@ var require_websocket_server = __commonJS({ "../../node_modules/.pnpm/ws@8.18.2/
|
|
23832
23866
|
return;
|
23833
23867
|
}
|
23834
23868
|
const secWebSocketProtocol = req$4.headers["sec-websocket-protocol"];
|
23835
|
-
let protocols = new Set();
|
23869
|
+
let protocols = /* @__PURE__ */ new Set();
|
23836
23870
|
if (secWebSocketProtocol !== void 0) try {
|
23837
23871
|
protocols = subprotocol.parse(secWebSocketProtocol);
|
23838
23872
|
} catch (err$2) {
|
@@ -24048,7 +24082,7 @@ function isHostAllowedInternal(hostHeader, allowedHosts) {
|
|
24048
24082
|
}
|
24049
24083
|
return false;
|
24050
24084
|
}
|
24051
|
-
const cache = new WeakMap();
|
24085
|
+
const cache = /* @__PURE__ */ new WeakMap();
|
24052
24086
|
/**
|
24053
24087
|
* Check if the host contained in the host header is allowed.
|
24054
24088
|
*
|
@@ -24061,7 +24095,7 @@ function isHostAllowed(hostHeader, allowedHosts) {
|
|
24061
24095
|
if (hostHeader === void 0) return true;
|
24062
24096
|
let cachedAllowedHosts;
|
24063
24097
|
if (Object.isFrozen(allowedHosts)) {
|
24064
|
-
if (!cache.has(allowedHosts)) cache.set(allowedHosts, new Set());
|
24098
|
+
if (!cache.has(allowedHosts)) cache.set(allowedHosts, /* @__PURE__ */ new Set());
|
24065
24099
|
cachedAllowedHosts = cache.get(allowedHosts);
|
24066
24100
|
if (cachedAllowedHosts.has(hostHeader)) return true;
|
24067
24101
|
}
|
@@ -24094,7 +24128,7 @@ function generateDefaultErrorMessage(hostname) {
|
|
24094
24128
|
|
24095
24129
|
//#endregion
|
24096
24130
|
//#region src/node/server/ws.ts
|
24097
|
-
var import_picocolors$15 = __toESM(require_picocolors()
|
24131
|
+
var import_picocolors$15 = __toESM(require_picocolors());
|
24098
24132
|
const WebSocketServerRaw = process.versions.bun ? import.meta.require("ws").WebSocketServer : import_websocket_server.default;
|
24099
24133
|
const HMR_HEADER = "vite-hmr";
|
24100
24134
|
const isWebSocketServer = Symbol("isWebSocketServer");
|
@@ -24119,7 +24153,7 @@ function createWebSocketServer(server, config$2, httpsOptions) {
|
|
24119
24153
|
if (config$2.server.ws === false) return {
|
24120
24154
|
[isWebSocketServer]: true,
|
24121
24155
|
get clients() {
|
24122
|
-
return new Set();
|
24156
|
+
return /* @__PURE__ */ new Set();
|
24123
24157
|
},
|
24124
24158
|
async close() {},
|
24125
24159
|
on: noop$2,
|
@@ -24134,14 +24168,14 @@ function createWebSocketServer(server, config$2, httpsOptions) {
|
|
24134
24168
|
send: noop$2
|
24135
24169
|
};
|
24136
24170
|
let wsHttpServer = void 0;
|
24137
|
-
const hmr = isObject
|
24171
|
+
const hmr = isObject(config$2.server.hmr) && config$2.server.hmr;
|
24138
24172
|
const hmrServer = hmr && hmr.server;
|
24139
24173
|
const hmrPort = hmr && hmr.port;
|
24140
24174
|
const portsAreCompatible = !hmrPort || hmrPort === config$2.server.port;
|
24141
24175
|
const wsServer = hmrServer || portsAreCompatible && server;
|
24142
24176
|
let hmrServerWsListener;
|
24143
|
-
const customListeners = new Map();
|
24144
|
-
const clientsMap = new WeakMap();
|
24177
|
+
const customListeners = /* @__PURE__ */ new Map();
|
24178
|
+
const clientsMap = /* @__PURE__ */ new WeakMap();
|
24145
24179
|
const port = hmrPort || 24678;
|
24146
24180
|
const host = hmr && hmr.host || void 0;
|
24147
24181
|
const allowedHosts = config$2.server.allowedHosts === true ? config$2.server.allowedHosts : Object.freeze([...config$2.server.allowedHosts]);
|
@@ -24261,7 +24295,7 @@ function createWebSocketServer(server, config$2, httpsOptions) {
|
|
24261
24295
|
});
|
24262
24296
|
},
|
24263
24297
|
on(event, fn) {
|
24264
|
-
if (!customListeners.has(event)) customListeners.set(event, new Set());
|
24298
|
+
if (!customListeners.has(event)) customListeners.set(event, /* @__PURE__ */ new Set());
|
24265
24299
|
customListeners.get(event).add(fn);
|
24266
24300
|
},
|
24267
24301
|
off(event, fn) {
|
@@ -25620,8 +25654,8 @@ var require_http_proxy = __commonJS({ "../../node_modules/.pnpm/http-proxy@1.18.
|
|
25620
25654
|
|
25621
25655
|
//#endregion
|
25622
25656
|
//#region src/node/server/middlewares/proxy.ts
|
25623
|
-
var import_http_proxy = __toESM(require_http_proxy()
|
25624
|
-
var import_picocolors$14 = __toESM(require_picocolors()
|
25657
|
+
var import_http_proxy = __toESM(require_http_proxy());
|
25658
|
+
var import_picocolors$14 = __toESM(require_picocolors());
|
25625
25659
|
const debug$5 = createDebugger("vite:proxy");
|
25626
25660
|
const rewriteOriginHeader = (proxyReq, options$1, config$2) => {
|
25627
25661
|
if (options$1.rewriteWsOrigin) {
|
@@ -25867,16 +25901,16 @@ var require_etag = __commonJS({ "../../node_modules/.pnpm/etag@1.8.1/node_module
|
|
25867
25901
|
|
25868
25902
|
//#endregion
|
25869
25903
|
//#region src/node/server/send.ts
|
25870
|
-
var import_convert_source_map$1 = __toESM(require_convert_source_map()
|
25871
|
-
var import_etag$1 = __toESM(require_etag()
|
25904
|
+
var import_convert_source_map$1 = __toESM(require_convert_source_map());
|
25905
|
+
var import_etag$1 = __toESM(require_etag());
|
25872
25906
|
const debug$3 = createDebugger("vite:send", { onlyWhenFocused: true });
|
25873
|
-
const alias = {
|
25907
|
+
const alias$1 = {
|
25874
25908
|
js: "text/javascript",
|
25875
25909
|
css: "text/css",
|
25876
25910
|
html: "text/html",
|
25877
25911
|
json: "application/json"
|
25878
25912
|
};
|
25879
|
-
function send
|
25913
|
+
function send(req$4, res, content, type, options$1) {
|
25880
25914
|
const { etag: etag$1 = (0, import_etag$1.default)(content, { weak: true }), cacheControl = "no-cache", headers, map: map$1 } = options$1;
|
25881
25915
|
if (res.writableEnded) return;
|
25882
25916
|
if (req$4.headers["if-none-match"] === etag$1) {
|
@@ -25884,7 +25918,7 @@ function send$1(req$4, res, content, type, options$1) {
|
|
25884
25918
|
res.end();
|
25885
25919
|
return;
|
25886
25920
|
}
|
25887
|
-
res.setHeader("Content-Type", alias[type] || type);
|
25921
|
+
res.setHeader("Content-Type", alias$1[type] || type);
|
25888
25922
|
res.setHeader("Cache-Control", cacheControl);
|
25889
25923
|
res.setHeader("Etag", etag$1);
|
25890
25924
|
if (headers) for (const name in headers) res.setHeader(name, headers[name]);
|
@@ -25936,7 +25970,7 @@ function totalist(dir, callback, pre = "") {
|
|
25936
25970
|
* @param {Request} req
|
25937
25971
|
* @returns {ParsedURL|void}
|
25938
25972
|
*/
|
25939
|
-
function parse(req$4) {
|
25973
|
+
function parse$1(req$4) {
|
25940
25974
|
let raw = req$4.url;
|
25941
25975
|
if (raw == null) return;
|
25942
25976
|
let prev = req$4._parsedUrl;
|
@@ -26001,7 +26035,7 @@ function viaLocal(dir, isEtag, uri, extns, shouldServe) {
|
|
26001
26035
|
function is404(req$4, res) {
|
26002
26036
|
return res.statusCode = 404, res.end();
|
26003
26037
|
}
|
26004
|
-
function send(req$4, res, file, stats, headers) {
|
26038
|
+
function send$1(req$4, res, file, stats, headers) {
|
26005
26039
|
let code = 200, tmp, opts = {};
|
26006
26040
|
headers = { ...headers };
|
26007
26041
|
for (let key in headers) {
|
@@ -26044,7 +26078,7 @@ function toHeaders(name, stats, isEtag) {
|
|
26044
26078
|
if (isEtag) headers["ETag"] = `W/"${stats.size}-${stats.mtime.getTime()}"`;
|
26045
26079
|
return headers;
|
26046
26080
|
}
|
26047
|
-
function build_default
|
26081
|
+
function build_default(dir, opts = {}) {
|
26048
26082
|
dir = resolve(dir || ".");
|
26049
26083
|
let isNotFound = opts.onNoMatch || is404;
|
26050
26084
|
let setHeaders$1 = opts.setHeaders || noop;
|
@@ -26084,7 +26118,7 @@ function build_default$1(dir, opts = {}) {
|
|
26084
26118
|
let lookup$1 = opts.dev ? viaLocal.bind(0, dir, isEtag) : viaCache.bind(0, FILES);
|
26085
26119
|
return function(req$4, res, next) {
|
26086
26120
|
let extns = [""];
|
26087
|
-
let pathname = parse(req$4).pathname;
|
26121
|
+
let pathname = parse$1(req$4).pathname;
|
26088
26122
|
let val = req$4.headers["accept-encoding"] || "";
|
26089
26123
|
if (gzips && val.includes("gzip")) extns.unshift(...gzips);
|
26090
26124
|
if (brots && /(br|brotli)/i.test(val)) extns.unshift(...brots);
|
@@ -26100,13 +26134,13 @@ function build_default$1(dir, opts = {}) {
|
|
26100
26134
|
}
|
26101
26135
|
if (gzips || brots) res.setHeader("Vary", "Accept-Encoding");
|
26102
26136
|
setHeaders$1(res, pathname, data.stats);
|
26103
|
-
send(req$4, res, data.abs, data.stats, data.headers);
|
26137
|
+
send$1(req$4, res, data.abs, data.stats, data.headers);
|
26104
26138
|
};
|
26105
26139
|
}
|
26106
26140
|
|
26107
26141
|
//#endregion
|
26108
26142
|
//#region src/node/server/middlewares/static.ts
|
26109
|
-
var import_escape_html$1 = __toESM(require_escape_html()
|
26143
|
+
var import_escape_html$1 = __toESM(require_escape_html());
|
26110
26144
|
const knownJavascriptExtensionRE = /\.(?:[tj]sx?|[cm][tj]s)$/;
|
26111
26145
|
const ERR_DENIED_FILE = "ERR_DENIED_FILE";
|
26112
26146
|
const sirvOptions = ({ config: config$2, getHeaders, disableFsServeCheck }) => {
|
@@ -26134,7 +26168,7 @@ const sirvOptions = ({ config: config$2, getHeaders, disableFsServeCheck }) => {
|
|
26134
26168
|
};
|
26135
26169
|
function servePublicMiddleware(server, publicFiles) {
|
26136
26170
|
const dir = server.config.publicDir;
|
26137
|
-
const serve = build_default
|
26171
|
+
const serve = build_default(dir, sirvOptions({
|
26138
26172
|
config: server.config,
|
26139
26173
|
getHeaders: () => server.config.server.headers,
|
26140
26174
|
disableFsServeCheck: true
|
@@ -26144,16 +26178,16 @@ function servePublicMiddleware(server, publicFiles) {
|
|
26144
26178
|
if (filePath.indexOf("%") !== -1) try {
|
26145
26179
|
filePath = decodeURI(filePath);
|
26146
26180
|
} catch {}
|
26147
|
-
return normalizePath
|
26181
|
+
return normalizePath(filePath);
|
26148
26182
|
};
|
26149
26183
|
return function viteServePublicMiddleware(req$4, res, next) {
|
26150
|
-
if (publicFiles && !publicFiles.has(toFilePath(req$4.url)) || isImportRequest(req$4.url) || isInternalRequest(req$4.url) || urlRE
|
26184
|
+
if (publicFiles && !publicFiles.has(toFilePath(req$4.url)) || isImportRequest(req$4.url) || isInternalRequest(req$4.url) || urlRE.test(req$4.url)) return next();
|
26151
26185
|
serve(req$4, res, next);
|
26152
26186
|
};
|
26153
26187
|
}
|
26154
26188
|
function serveStaticMiddleware(server) {
|
26155
26189
|
const dir = server.config.root;
|
26156
|
-
const serve = build_default
|
26190
|
+
const serve = build_default(dir, sirvOptions({
|
26157
26191
|
config: server.config,
|
26158
26192
|
getHeaders: () => server.config.server.headers
|
26159
26193
|
}));
|
@@ -26192,7 +26226,7 @@ function serveStaticMiddleware(server) {
|
|
26192
26226
|
};
|
26193
26227
|
}
|
26194
26228
|
function serveRawFsMiddleware(server) {
|
26195
|
-
const serveFromRoot = build_default
|
26229
|
+
const serveFromRoot = build_default("/", sirvOptions({
|
26196
26230
|
config: server.config,
|
26197
26231
|
getHeaders: () => server.config.server.headers
|
26198
26232
|
}));
|
@@ -26201,7 +26235,7 @@ function serveRawFsMiddleware(server) {
|
|
26201
26235
|
const url$6 = new URL(req$4.url, "http://example.com");
|
26202
26236
|
const pathname = decodeURI(url$6.pathname);
|
26203
26237
|
let newPathname = pathname.slice(FS_PREFIX.length);
|
26204
|
-
if (isWindows
|
26238
|
+
if (isWindows) newPathname = newPathname.replace(/^[A-Z]:/i, "");
|
26205
26239
|
url$6.pathname = encodeURI(newPathname);
|
26206
26240
|
req$4.url = url$6.href.slice(url$6.origin.length);
|
26207
26241
|
try {
|
@@ -26235,7 +26269,7 @@ function isFileLoadingAllowed(config$2, filePath) {
|
|
26235
26269
|
return false;
|
26236
26270
|
}
|
26237
26271
|
function checkLoadingAccess(config$2, path$13) {
|
26238
|
-
if (isFileLoadingAllowed(config$2, slash
|
26272
|
+
if (isFileLoadingAllowed(config$2, slash(path$13))) return "allowed";
|
26239
26273
|
if (isFileReadable(path$13)) return "denied";
|
26240
26274
|
return "fallback";
|
26241
26275
|
}
|
@@ -26273,8 +26307,8 @@ function renderRestrictedErrorHTML(msg) {
|
|
26273
26307
|
|
26274
26308
|
//#endregion
|
26275
26309
|
//#region src/node/server/transformRequest.ts
|
26276
|
-
var import_etag = __toESM(require_etag()
|
26277
|
-
var import_picocolors$13 = __toESM(require_picocolors()
|
26310
|
+
var import_etag = __toESM(require_etag());
|
26311
|
+
var import_picocolors$13 = __toESM(require_picocolors());
|
26278
26312
|
const ERR_LOAD_URL = "ERR_LOAD_URL";
|
26279
26313
|
const ERR_LOAD_PUBLIC_URL = "ERR_LOAD_PUBLIC_URL";
|
26280
26314
|
const ERR_DENIED_ID = "ERR_DENIED_ID";
|
@@ -26288,7 +26322,7 @@ function transformRequest(environment, url$6, options$1 = {}) {
|
|
26288
26322
|
};
|
26289
26323
|
if (environment._closing && environment.config.dev.recoverable) throwClosedServerError();
|
26290
26324
|
const cacheKey = `${options$1.html ? "html:" : ""}${url$6}`;
|
26291
|
-
const timestamp =
|
26325
|
+
const timestamp = monotonicDateNow();
|
26292
26326
|
const pending = environment._pendingRequests.get(cacheKey);
|
26293
26327
|
if (pending) return environment.moduleGraph.getModuleByUrl(removeTimestampQuery(url$6)).then((module$1) => {
|
26294
26328
|
if (!module$1 || pending.timestamp > module$1.lastInvalidationTimestamp) return pending.request;
|
@@ -26385,7 +26419,7 @@ async function loadAndTransform(environment, id, url$6, options$1, timestamp, mo
|
|
26385
26419
|
}
|
26386
26420
|
} else {
|
26387
26421
|
debugLoad?.(`${timeFrom(loadStart)} [plugin] ${prettyUrl}`);
|
26388
|
-
if (isObject
|
26422
|
+
if (isObject(loadResult)) {
|
26389
26423
|
code = loadResult.code;
|
26390
26424
|
map$1 = loadResult.map;
|
26391
26425
|
} else code = loadResult;
|
@@ -26458,17 +26492,17 @@ async function handleModuleSoftInvalidation(environment, mod, timestamp) {
|
|
26458
26492
|
let result;
|
26459
26493
|
if (transformResult.ssr) result = transformResult;
|
26460
26494
|
else {
|
26461
|
-
await init
|
26495
|
+
await init;
|
26462
26496
|
const source = transformResult.code;
|
26463
26497
|
const s$2 = new MagicString(source);
|
26464
|
-
const [imports] = parse
|
26498
|
+
const [imports] = parse(source, mod.id || void 0);
|
26465
26499
|
for (const imp of imports) {
|
26466
26500
|
let rawUrl = source.slice(imp.s, imp.e);
|
26467
26501
|
if (rawUrl === "import.meta") continue;
|
26468
26502
|
const hasQuotes = rawUrl[0] === "\"" || rawUrl[0] === "'";
|
26469
26503
|
if (hasQuotes) rawUrl = rawUrl.slice(1, -1);
|
26470
26504
|
const urlWithoutTimestamp = removeTimestampQuery(rawUrl);
|
26471
|
-
const hmrUrl = unwrapId
|
26505
|
+
const hmrUrl = unwrapId(stripBase(removeImportQuery(urlWithoutTimestamp), environment.config.base));
|
26472
26506
|
for (const importedMod of mod.importedModules) {
|
26473
26507
|
if (importedMod.url !== hmrUrl) continue;
|
26474
26508
|
if (importedMod.lastHMRTimestamp > 0) {
|
@@ -26638,8 +26672,8 @@ function polyfill() {
|
|
26638
26672
|
|
26639
26673
|
//#endregion
|
26640
26674
|
//#region src/node/plugins/html.ts
|
26641
|
-
var import_picocolors$12 = __toESM(require_picocolors()
|
26642
|
-
var import_escape_html = __toESM(require_escape_html()
|
26675
|
+
var import_picocolors$12 = __toESM(require_picocolors());
|
26676
|
+
var import_escape_html = __toESM(require_escape_html());
|
26643
26677
|
const htmlProxyRE$1 = /[?&]html-proxy=?(?:&inline-css)?(?:&style-attr)?&index=(\d+)\.(?:js|css)$/;
|
26644
26678
|
const isHtmlProxyRE = /[?&]html-proxy\b/;
|
26645
26679
|
const inlineCSSRE$1 = /__VITE_INLINE_CSS__([a-z\d]{8}_\d+)__/g;
|
@@ -26652,10 +26686,10 @@ const modulePreloadLinkRE = /[ \t]*<link[^>]*rel\s*=\s*(?:"modulepreload"|'modul
|
|
26652
26686
|
const importMapAppendRE = new RegExp([moduleScriptRE, modulePreloadLinkRE].map((r$2) => r$2.source).join("|"), "i");
|
26653
26687
|
const isHTMLProxy = (id) => isHtmlProxyRE.test(id);
|
26654
26688
|
const isHTMLRequest = (request) => htmlLangRE.test(request);
|
26655
|
-
const htmlProxyMap = new WeakMap();
|
26656
|
-
const htmlProxyResult = new Map();
|
26689
|
+
const htmlProxyMap = /* @__PURE__ */ new WeakMap();
|
26690
|
+
const htmlProxyResult = /* @__PURE__ */ new Map();
|
26657
26691
|
function htmlInlineProxyPlugin(config$2) {
|
26658
|
-
htmlProxyMap.set(config$2, new Map());
|
26692
|
+
htmlProxyMap.set(config$2, /* @__PURE__ */ new Map());
|
26659
26693
|
return {
|
26660
26694
|
name: "vite:html-inline-proxy",
|
26661
26695
|
resolveId: { handler(id) {
|
@@ -26666,7 +26700,7 @@ function htmlInlineProxyPlugin(config$2) {
|
|
26666
26700
|
if (proxyMatch) {
|
26667
26701
|
const index = Number(proxyMatch[1]);
|
26668
26702
|
const file = cleanUrl(id);
|
26669
|
-
const url$6 = file.replace(normalizePath
|
26703
|
+
const url$6 = file.replace(normalizePath(config$2.root), "");
|
26670
26704
|
const result = htmlProxyMap.get(config$2).get(url$6)?.[index];
|
26671
26705
|
if (result) return {
|
26672
26706
|
...result,
|
@@ -26678,7 +26712,7 @@ function htmlInlineProxyPlugin(config$2) {
|
|
26678
26712
|
};
|
26679
26713
|
}
|
26680
26714
|
function addToHTMLProxyCache(config$2, filePath, index, result) {
|
26681
|
-
if (!htmlProxyMap.get(config$2)) htmlProxyMap.set(config$2, new Map());
|
26715
|
+
if (!htmlProxyMap.get(config$2)) htmlProxyMap.set(config$2, /* @__PURE__ */ new Map());
|
26682
26716
|
if (!htmlProxyMap.get(config$2).get(filePath)) htmlProxyMap.get(config$2).set(filePath, []);
|
26683
26717
|
htmlProxyMap.get(config$2).get(filePath)[index] = result;
|
26684
26718
|
}
|
@@ -26691,7 +26725,7 @@ const noInlineLinkRels = new Set([
|
|
26691
26725
|
"apple-touch-startup-image",
|
26692
26726
|
"manifest"
|
26693
26727
|
]);
|
26694
|
-
const isAsyncScriptMap = new WeakMap();
|
26728
|
+
const isAsyncScriptMap = /* @__PURE__ */ new WeakMap();
|
26695
26729
|
function nodeIsElement(node) {
|
26696
26730
|
return node.nodeName[0] !== "#";
|
26697
26731
|
}
|
@@ -26701,7 +26735,7 @@ function traverseNodes(node, visitor) {
|
|
26701
26735
|
if (nodeIsElement(node) || node.nodeName === "#document" || node.nodeName === "#document-fragment") node.childNodes.forEach((childNode) => traverseNodes(childNode, visitor));
|
26702
26736
|
}
|
26703
26737
|
async function traverseHtml(html, filePath, visitor) {
|
26704
|
-
const { parse: parse$16 } = await import("./dep-
|
26738
|
+
const { parse: parse$16 } = await import("./dep-BO5GbxpL.js");
|
26705
26739
|
const ast = parse$16(html, {
|
26706
26740
|
scriptingEnabled: false,
|
26707
26741
|
sourceCodeLocationInfo: true,
|
@@ -26788,15 +26822,15 @@ function buildHtmlPlugin(config$2) {
|
|
26788
26822
|
preHooks.push(htmlEnvHook(config$2));
|
26789
26823
|
postHooks.push(injectNonceAttributeTagHook(config$2));
|
26790
26824
|
postHooks.push(postImportMapHook());
|
26791
|
-
const processedHtml = perEnvironmentState(() => new Map());
|
26825
|
+
const processedHtml = perEnvironmentState(() => /* @__PURE__ */ new Map());
|
26792
26826
|
const isExcludedUrl = (url$6) => url$6[0] === "#" || isExternalUrl(url$6) || isDataUrl(url$6);
|
26793
|
-
isAsyncScriptMap.set(config$2, new Map());
|
26827
|
+
isAsyncScriptMap.set(config$2, /* @__PURE__ */ new Map());
|
26794
26828
|
return {
|
26795
26829
|
name: "vite:build-html",
|
26796
26830
|
transform: { async handler(html, id) {
|
26797
26831
|
if (id.endsWith(".html")) {
|
26798
|
-
id = normalizePath
|
26799
|
-
const relativeUrlPath = normalizePath
|
26832
|
+
id = normalizePath(id);
|
26833
|
+
const relativeUrlPath = normalizePath(path.relative(config$2.root, id));
|
26800
26834
|
const publicPath = `/${relativeUrlPath}`;
|
26801
26835
|
const publicBase = getBaseInHTML(relativeUrlPath, config$2);
|
26802
26836
|
const publicToRelative = (filename) => publicBase + filename;
|
@@ -26861,7 +26895,7 @@ function buildHtmlPlugin(config$2) {
|
|
26861
26895
|
} else if (node.childNodes.length) {
|
26862
26896
|
const scriptNode = node.childNodes.pop();
|
26863
26897
|
const contents = scriptNode.value;
|
26864
|
-
const filePath = id.replace(normalizePath
|
26898
|
+
const filePath = id.replace(normalizePath(config$2.root), "");
|
26865
26899
|
addToHTMLProxyCache(config$2, filePath, inlineModuleIndex, { code: contents });
|
26866
26900
|
js += `\nimport "${id}?html-proxy&index=${inlineModuleIndex}.js"`;
|
26867
26901
|
shouldRemove = true;
|
@@ -26916,7 +26950,7 @@ function buildHtmlPlugin(config$2) {
|
|
26916
26950
|
if (inlineStyle) {
|
26917
26951
|
inlineModuleIndex++;
|
26918
26952
|
const code = inlineStyle.attr.value;
|
26919
|
-
const filePath = id.replace(normalizePath
|
26953
|
+
const filePath = id.replace(normalizePath(config$2.root), "");
|
26920
26954
|
addToHTMLProxyCache(config$2, filePath, inlineModuleIndex, { code });
|
26921
26955
|
js += `\nimport "${id}?html-proxy&inline-css&style-attr&index=${inlineModuleIndex}.css"`;
|
26922
26956
|
const hash$1 = getHash(cleanUrl(id));
|
@@ -26924,7 +26958,7 @@ function buildHtmlPlugin(config$2) {
|
|
26924
26958
|
}
|
26925
26959
|
if (node.nodeName === "style" && node.childNodes.length) {
|
26926
26960
|
const styleNode = node.childNodes.pop();
|
26927
|
-
const filePath = id.replace(normalizePath
|
26961
|
+
const filePath = id.replace(normalizePath(config$2.root), "");
|
26928
26962
|
inlineModuleIndex++;
|
26929
26963
|
addToHTMLProxyCache(config$2, filePath, inlineModuleIndex, { code: styleNode.value });
|
26930
26964
|
js += `\nimport "${id}?html-proxy&inline-css&index=${inlineModuleIndex}.css"`;
|
@@ -26958,9 +26992,9 @@ function buildHtmlPlugin(config$2) {
|
|
26958
26992
|
}
|
26959
26993
|
} },
|
26960
26994
|
async generateBundle(options$1, bundle) {
|
26961
|
-
const analyzedImportedCssFiles = new Map();
|
26962
|
-
const inlineEntryChunk = new Set();
|
26963
|
-
const getImportedChunks = (chunk, seen$1 = new Set()) => {
|
26995
|
+
const analyzedImportedCssFiles = /* @__PURE__ */ new Map();
|
26996
|
+
const inlineEntryChunk = /* @__PURE__ */ new Set();
|
26997
|
+
const getImportedChunks = (chunk, seen$1 = /* @__PURE__ */ new Set()) => {
|
26964
26998
|
const chunks = [];
|
26965
26999
|
chunk.imports.forEach((file) => {
|
26966
27000
|
const importee = bundle[file];
|
@@ -26999,7 +27033,7 @@ function buildHtmlPlugin(config$2) {
|
|
26999
27033
|
href: toOutputPath(file)
|
27000
27034
|
}
|
27001
27035
|
});
|
27002
|
-
const getCssFilesForChunk = (chunk, seenChunks = new Set(), seenCss = new Set()) => {
|
27036
|
+
const getCssFilesForChunk = (chunk, seenChunks = /* @__PURE__ */ new Set(), seenCss = /* @__PURE__ */ new Set()) => {
|
27003
27037
|
if (seenChunks.has(chunk.fileName)) return [];
|
27004
27038
|
seenChunks.add(chunk.fileName);
|
27005
27039
|
if (analyzedImportedCssFiles.has(chunk)) {
|
@@ -27024,7 +27058,7 @@ function buildHtmlPlugin(config$2) {
|
|
27024
27058
|
};
|
27025
27059
|
const getCssTagsForChunk = (chunk, toOutputPath) => getCssFilesForChunk(chunk).map((file) => toStyleSheetLinkTag(file, toOutputPath));
|
27026
27060
|
for (const [normalizedId, html] of processedHtml(this)) {
|
27027
|
-
const relativeUrlPath = normalizePath
|
27061
|
+
const relativeUrlPath = normalizePath(path.relative(config$2.root, normalizedId));
|
27028
27062
|
const assetsBase = getBaseInHTML(relativeUrlPath, config$2);
|
27029
27063
|
const toOutputFilePath = (filename, type) => {
|
27030
27064
|
if (isExternalUrl(filename)) return filename;
|
@@ -27034,7 +27068,7 @@ function buildHtmlPlugin(config$2) {
|
|
27034
27068
|
const toOutputPublicAssetFilePath = (filename) => toOutputFilePath(filename, "public");
|
27035
27069
|
const isAsync = isAsyncScriptMap.get(config$2).get(normalizedId);
|
27036
27070
|
let result = html;
|
27037
|
-
const chunk = Object.values(bundle).find((chunk$1) => chunk$1.type === "chunk" && chunk$1.isEntry && chunk$1.facadeModuleId && normalizePath
|
27071
|
+
const chunk = Object.values(bundle).find((chunk$1) => chunk$1.type === "chunk" && chunk$1.isEntry && chunk$1.facadeModuleId && normalizePath(chunk$1.facadeModuleId) === normalizedId);
|
27038
27072
|
let canInlineEntry = false;
|
27039
27073
|
if (chunk) {
|
27040
27074
|
if (options$1.format === "es" && isEntirelyImport(chunk.code)) canInlineEntry = true;
|
@@ -27092,10 +27126,10 @@ function buildHtmlPlugin(config$2) {
|
|
27092
27126
|
});
|
27093
27127
|
result = result.replace(publicAssetUrlRE, (_, fileHash) => {
|
27094
27128
|
const publicAssetPath = toOutputPublicAssetFilePath(getPublicAssetFilename(fileHash, config$2));
|
27095
|
-
return encodeURIPath(URL$1.canParse(publicAssetPath) ? publicAssetPath : normalizePath
|
27129
|
+
return encodeURIPath(URL$1.canParse(publicAssetPath) ? publicAssetPath : normalizePath(publicAssetPath));
|
27096
27130
|
});
|
27097
27131
|
if (chunk && canInlineEntry) inlineEntryChunk.add(chunk.fileName);
|
27098
|
-
const shortEmitName = normalizePath
|
27132
|
+
const shortEmitName = normalizePath(path.relative(config$2.root, normalizedId));
|
27099
27133
|
this.emitFile({
|
27100
27134
|
type: "asset",
|
27101
27135
|
originalFileName: normalizedId,
|
@@ -27144,7 +27178,7 @@ function preImportMapHook(config$2) {
|
|
27144
27178
|
const importMapAppendIndex = html.search(importMapAppendRE);
|
27145
27179
|
if (importMapAppendIndex < 0) return;
|
27146
27180
|
if (importMapAppendIndex < importMapIndex) {
|
27147
|
-
const relativeHtml = normalizePath
|
27181
|
+
const relativeHtml = normalizePath(path.relative(config$2.root, ctx.filename));
|
27148
27182
|
config$2.logger.warnOnce(import_picocolors$12.default.yellow(import_picocolors$12.default.bold(`(!) <script type="importmap"> should come before <script type="module"> and <link rel="modulepreload"> in /${relativeHtml}`)));
|
27149
27183
|
}
|
27150
27184
|
};
|
@@ -27199,7 +27233,7 @@ function htmlEnvHook(config$2) {
|
|
27199
27233
|
if (key in env$2) return env$2[key];
|
27200
27234
|
else {
|
27201
27235
|
if (envPrefix.some((prefix$1) => key.startsWith(prefix$1))) {
|
27202
|
-
const relativeHtml = normalizePath
|
27236
|
+
const relativeHtml = normalizePath(path.relative(config$2.root, ctx.filename));
|
27203
27237
|
config$2.logger.warn(import_picocolors$12.default.yellow(import_picocolors$12.default.bold(`(!) ${text} is not defined in env variables found in /${relativeHtml}. Is the variable mistyped?`)));
|
27204
27238
|
}
|
27205
27239
|
return text;
|
@@ -27382,16 +27416,16 @@ function decodeURIIfPossible(input) {
|
|
27382
27416
|
|
27383
27417
|
//#endregion
|
27384
27418
|
//#region src/node/server/middlewares/transform.ts
|
27385
|
-
var import_picocolors$11 = __toESM(require_picocolors()
|
27419
|
+
var import_picocolors$11 = __toESM(require_picocolors());
|
27386
27420
|
const debugCache = createDebugger("vite:cache");
|
27387
27421
|
const knownIgnoreList = new Set(["/", "/favicon.ico"]);
|
27388
27422
|
const trailingQuerySeparatorsRE = /[?&]+$/;
|
27389
|
-
const urlRE = /[?&]url\b/;
|
27390
|
-
const rawRE = /[?&]raw\b/;
|
27423
|
+
const urlRE$1 = /[?&]url\b/;
|
27424
|
+
const rawRE$1 = /[?&]raw\b/;
|
27391
27425
|
const inlineRE$2 = /[?&]inline\b/;
|
27392
27426
|
const svgRE = /\.svg\b/;
|
27393
27427
|
function deniedServingAccessForTransform(url$6, server, res, next) {
|
27394
|
-
if (rawRE.test(url$6) || urlRE.test(url$6) || inlineRE$2.test(url$6) || svgRE.test(url$6)) {
|
27428
|
+
if (rawRE$1.test(url$6) || urlRE$1.test(url$6) || inlineRE$2.test(url$6) || svgRE.test(url$6)) {
|
27395
27429
|
const servingAccessResult = checkServingAccess(url$6, server);
|
27396
27430
|
if (servingAccessResult === "denied") {
|
27397
27431
|
respondWithAccessDenied(url$6, server, res);
|
@@ -27448,11 +27482,11 @@ function transformMiddleware(server) {
|
|
27448
27482
|
if (isSourceMap) {
|
27449
27483
|
const depsOptimizer = environment.depsOptimizer;
|
27450
27484
|
if (depsOptimizer?.isOptimizedDepUrl(url$6)) {
|
27451
|
-
const sourcemapPath = url$6.startsWith(FS_PREFIX) ? fsPathFromId(url$6) : normalizePath
|
27485
|
+
const sourcemapPath = url$6.startsWith(FS_PREFIX) ? fsPathFromId(url$6) : normalizePath(path.resolve(server.config.root, url$6.slice(1)));
|
27452
27486
|
try {
|
27453
27487
|
const map$1 = JSON.parse(await fsp.readFile(sourcemapPath, "utf-8"));
|
27454
27488
|
applySourcemapIgnoreList(map$1, sourcemapPath, server.config.server.sourcemapIgnoreList, server.config.logger);
|
27455
|
-
return send
|
27489
|
+
return send(req$4, res, JSON.stringify(map$1), "json", { headers: server.config.server.headers });
|
27456
27490
|
} catch {
|
27457
27491
|
const dummySourceMap = {
|
27458
27492
|
version: 3,
|
@@ -27462,7 +27496,7 @@ function transformMiddleware(server) {
|
|
27462
27496
|
names: [],
|
27463
27497
|
mappings: ";;;;;;;;;"
|
27464
27498
|
};
|
27465
|
-
return send
|
27499
|
+
return send(req$4, res, JSON.stringify(dummySourceMap), "json", {
|
27466
27500
|
cacheControl: "no-cache",
|
27467
27501
|
headers: server.config.server.headers
|
27468
27502
|
});
|
@@ -27470,16 +27504,16 @@ function transformMiddleware(server) {
|
|
27470
27504
|
} else {
|
27471
27505
|
const originalUrl = url$6.replace(/\.map($|\?)/, "$1");
|
27472
27506
|
const map$1 = (await environment.moduleGraph.getModuleByUrl(originalUrl))?.transformResult?.map;
|
27473
|
-
if (map$1) return send
|
27507
|
+
if (map$1) return send(req$4, res, JSON.stringify(map$1), "json", { headers: server.config.server.headers });
|
27474
27508
|
else return next();
|
27475
27509
|
}
|
27476
27510
|
}
|
27477
27511
|
if (publicDirInRoot && url$6.startsWith(publicPath)) warnAboutExplicitPublicPathInUrl(url$6);
|
27478
27512
|
const urlWithoutTrailingQuerySeparators = url$6.replace(trailingQuerySeparatorsRE, "");
|
27479
|
-
if (deniedServingAccessForTransform(urlWithoutTrailingQuerySeparators, server, res, next)) return;
|
27513
|
+
if (!url$6.startsWith("/@id/\0") && deniedServingAccessForTransform(urlWithoutTrailingQuerySeparators, server, res, next)) return;
|
27480
27514
|
if (req$4.headers["sec-fetch-dest"] === "script" || isJSRequest(url$6) || isImportRequest(url$6) || isCSSRequest(url$6) || isHTMLProxy(url$6)) {
|
27481
27515
|
url$6 = removeImportQuery(url$6);
|
27482
|
-
url$6 = unwrapId
|
27516
|
+
url$6 = unwrapId(url$6);
|
27483
27517
|
if (isCSSRequest(url$6)) {
|
27484
27518
|
if (req$4.headers.accept?.includes("text/css") && !isDirectRequest(url$6)) url$6 = injectQuery(url$6, "direct");
|
27485
27519
|
const ifNoneMatch = req$4.headers["if-none-match"];
|
@@ -27492,14 +27526,14 @@ function transformMiddleware(server) {
|
|
27492
27526
|
const result = await transformRequest(environment, url$6, {
|
27493
27527
|
html: req$4.headers.accept?.includes("text/html"),
|
27494
27528
|
allowId(id) {
|
27495
|
-
return !deniedServingAccessForTransform(id, server, res, next);
|
27529
|
+
return id.startsWith("\0") || !deniedServingAccessForTransform(id, server, res, next);
|
27496
27530
|
}
|
27497
27531
|
});
|
27498
27532
|
if (result) {
|
27499
27533
|
const depsOptimizer = environment.depsOptimizer;
|
27500
27534
|
const type = isDirectCSSRequest(url$6) ? "css" : "js";
|
27501
27535
|
const isDep = DEP_VERSION_RE.test(url$6) || depsOptimizer?.isOptimizedDepUrl(url$6);
|
27502
|
-
return send
|
27536
|
+
return send(req$4, res, result.code, type, {
|
27503
27537
|
etag: result.etag,
|
27504
27538
|
cacheControl: isDep ? "max-age=31536000,immutable" : "no-cache",
|
27505
27539
|
headers: server.config.server.headers,
|
@@ -27551,7 +27585,7 @@ function transformMiddleware(server) {
|
|
27551
27585
|
let warning;
|
27552
27586
|
if (isImportRequest(url$6)) {
|
27553
27587
|
const rawUrl = removeImportQuery(url$6);
|
27554
|
-
if (urlRE.test(url$6)) warning = `Assets in the public directory are served at the root path.\nInstead of ${import_picocolors$11.default.cyan(rawUrl)}, use ${import_picocolors$11.default.cyan(rawUrl.replace(publicPath, "/"))}.`;
|
27588
|
+
if (urlRE$1.test(url$6)) warning = `Assets in the public directory are served at the root path.\nInstead of ${import_picocolors$11.default.cyan(rawUrl)}, use ${import_picocolors$11.default.cyan(rawUrl.replace(publicPath, "/"))}.`;
|
27555
27589
|
else warning = `Assets in public directory cannot be imported from JavaScript.
|
27556
27590
|
If you intend to import that asset, put the file in the src directory, and use ${import_picocolors$11.default.cyan(rawUrl.replace(publicPath, "/src/"))} instead of ${import_picocolors$11.default.cyan(rawUrl)}.\nIf you intend to use the URL of that asset, use ${import_picocolors$11.default.cyan(injectQuery(rawUrl.replace(publicPath, "/"), "url"))}.`;
|
27557
27591
|
} else warning = `Files in the public directory are served at the root path.\nInstead of ${import_picocolors$11.default.cyan(url$6)}, use ${import_picocolors$11.default.cyan(url$6.replace(publicPath, "/"))}.`;
|
@@ -27589,7 +27623,7 @@ function createDevHtmlTransformFn(config$2) {
|
|
27589
27623
|
}
|
27590
27624
|
function getHtmlFilename(url$6, server) {
|
27591
27625
|
if (url$6.startsWith(FS_PREFIX)) return decodeURIComponent(fsPathFromId(url$6));
|
27592
|
-
else return decodeURIComponent(normalizePath
|
27626
|
+
else return decodeURIComponent(normalizePath(path.join(server.config.root, url$6.slice(1))));
|
27593
27627
|
}
|
27594
27628
|
function shouldPreTransform(url$6, config$2) {
|
27595
27629
|
return !checkPublicFile(url$6, config$2) && (isJSRequest(url$6) || isCSSRequest(url$6));
|
@@ -27636,12 +27670,12 @@ const devHtmlHook = async (html, { path: htmlPath, filename, server, originalUrl
|
|
27636
27670
|
} else {
|
27637
27671
|
const validPath = `${htmlPath}${trailingSlash ? "index.html" : ""}`;
|
27638
27672
|
proxyModulePath = `\0${validPath}`;
|
27639
|
-
proxyModuleUrl = wrapId
|
27673
|
+
proxyModuleUrl = wrapId(proxyModulePath);
|
27640
27674
|
}
|
27641
27675
|
proxyModuleUrl = joinUrlSegments(decodedBase, proxyModuleUrl);
|
27642
27676
|
const s$2 = new MagicString(html);
|
27643
27677
|
let inlineModuleIndex = -1;
|
27644
|
-
const proxyCacheUrl = decodeURI(cleanUrl(proxyModulePath).replace(normalizePath
|
27678
|
+
const proxyCacheUrl = decodeURI(cleanUrl(proxyModulePath).replace(normalizePath(config$2.root), ""));
|
27645
27679
|
const styleUrl = [];
|
27646
27680
|
const inlineStyles = [];
|
27647
27681
|
const inlineModulePaths = [];
|
@@ -27757,7 +27791,7 @@ function indexHtmlMiddleware(root, server) {
|
|
27757
27791
|
try {
|
27758
27792
|
let html = await fsp.readFile(filePath, "utf-8");
|
27759
27793
|
if (isDev) html = await server.transformIndexHtml(url$6, html, req$4.originalUrl);
|
27760
|
-
return send
|
27794
|
+
return send(req$4, res, html, "html", { headers });
|
27761
27795
|
} catch (e$1) {
|
27762
27796
|
return next(e$1);
|
27763
27797
|
}
|
@@ -27768,7 +27802,7 @@ function indexHtmlMiddleware(root, server) {
|
|
27768
27802
|
}
|
27769
27803
|
function preTransformRequest(server, decodedUrl, decodedBase) {
|
27770
27804
|
if (!server.config.server.preTransformRequests) return;
|
27771
|
-
decodedUrl = unwrapId
|
27805
|
+
decodedUrl = unwrapId(stripBase(decodedUrl, decodedBase));
|
27772
27806
|
server.warmupRequest(decodedUrl);
|
27773
27807
|
}
|
27774
27808
|
|
@@ -27813,12 +27847,12 @@ var ModuleNode = class {
|
|
27813
27847
|
if (this._ssrModule) this._ssrModule[prop] = value$1;
|
27814
27848
|
}
|
27815
27849
|
_wrapModuleSet(prop, module$1) {
|
27816
|
-
if (!module$1) return new Set();
|
27850
|
+
if (!module$1) return /* @__PURE__ */ new Set();
|
27817
27851
|
return createBackwardCompatibleModuleSet(this._moduleGraph, prop, module$1);
|
27818
27852
|
}
|
27819
27853
|
_getModuleSetUnion(prop) {
|
27820
|
-
const importedModules = new Set();
|
27821
|
-
const ids = new Set();
|
27854
|
+
const importedModules = /* @__PURE__ */ new Set();
|
27855
|
+
const ids = /* @__PURE__ */ new Set();
|
27822
27856
|
if (this._clientModule) for (const mod of this._clientModule[prop]) {
|
27823
27857
|
if (mod.id) ids.add(mod.id);
|
27824
27858
|
importedModules.add(this._moduleGraph.getBackwardCompatibleModuleNode(mod));
|
@@ -27995,7 +28029,7 @@ var ModuleGraph = class {
|
|
27995
28029
|
const clientModules = this._client.getModulesByFile(file);
|
27996
28030
|
const ssrModules = this._ssr.getModulesByFile(file);
|
27997
28031
|
if (!clientModules && !ssrModules) return void 0;
|
27998
|
-
const result = new Set();
|
28032
|
+
const result = /* @__PURE__ */ new Set();
|
27999
28033
|
if (clientModules) for (const mod of clientModules) result.add(this.getBackwardCompatibleBrowserModuleNode(mod));
|
28000
28034
|
if (ssrModules) {
|
28001
28035
|
for (const mod of ssrModules) if (mod.id == null || !this._client.getModuleById(mod.id)) result.add(this.getBackwardCompatibleServerModuleNode(mod));
|
@@ -28018,7 +28052,7 @@ var ModuleGraph = class {
|
|
28018
28052
|
default: throw new Error(`Invalid module node environment ${environment}`);
|
28019
28053
|
}
|
28020
28054
|
}
|
28021
|
-
invalidateModule(mod, seen$1 = new Set(), timestamp =
|
28055
|
+
invalidateModule(mod, seen$1 = /* @__PURE__ */ new Set(), timestamp = monotonicDateNow(), isHmr = false, softInvalidate = false) {
|
28022
28056
|
if (mod._clientModule) this._client.invalidateModule(mod._clientModule, new Set([...seen$1].map((mod$1) => mod$1._clientModule).filter(Boolean)), timestamp, isHmr, softInvalidate);
|
28023
28057
|
if (mod._ssrModule) this._ssr.invalidateModule(mod._ssrModule, new Set([...seen$1].map((mod$1) => mod$1._ssrModule).filter(Boolean)), timestamp, isHmr, softInvalidate);
|
28024
28058
|
}
|
@@ -28064,7 +28098,7 @@ var ModuleGraph = class {
|
|
28064
28098
|
}
|
28065
28099
|
};
|
28066
28100
|
var DualWeakMap = class {
|
28067
|
-
map = new WeakMap();
|
28101
|
+
map = /* @__PURE__ */ new WeakMap();
|
28068
28102
|
undefinedKey = {};
|
28069
28103
|
get(key1, key2) {
|
28070
28104
|
const k1 = key1 ?? this.undefinedKey;
|
@@ -28074,7 +28108,7 @@ var DualWeakMap = class {
|
|
28074
28108
|
set(key1, key2, value$1) {
|
28075
28109
|
const k1 = key1 ?? this.undefinedKey;
|
28076
28110
|
const k2 = key2 ?? this.undefinedKey;
|
28077
|
-
if (!this.map.has(k1)) this.map.set(k1, new Map());
|
28111
|
+
if (!this.map.has(k1)) this.map.set(k1, /* @__PURE__ */ new Map());
|
28078
28112
|
const m$2 = this.map.get(k1);
|
28079
28113
|
m$2.set(k2, value$1);
|
28080
28114
|
}
|
@@ -28170,7 +28204,7 @@ function createBackwardCompatibleFileToModulesMap(moduleGraph) {
|
|
28170
28204
|
const clientModules = moduleGraph._client.fileToModulesMap.get(key);
|
28171
28205
|
const ssrModules = moduleGraph._ssr.fileToModulesMap.get(key);
|
28172
28206
|
if (!clientModules && !ssrModules) return;
|
28173
|
-
const modules = clientModules ?? new Set();
|
28207
|
+
const modules = clientModules ?? /* @__PURE__ */ new Set();
|
28174
28208
|
if (ssrModules) {
|
28175
28209
|
for (const ssrModule of ssrModules) if (ssrModule.id) {
|
28176
28210
|
let found$1 = false;
|
@@ -28291,12 +28325,12 @@ function rejectInvalidRequestMiddleware() {
|
|
28291
28325
|
|
28292
28326
|
//#endregion
|
28293
28327
|
//#region src/node/server/index.ts
|
28294
|
-
var import_connect$1 = __toESM(require_connect()
|
28295
|
-
var import_lib$1 = __toESM(require_lib()
|
28296
|
-
var import_picocolors$10 = __toESM(require_picocolors()
|
28297
|
-
var import_chokidar = __toESM(require_chokidar()
|
28298
|
-
var import_launch_editor_middleware = __toESM(require_launch_editor_middleware()
|
28299
|
-
const usedConfigs = new WeakSet();
|
28328
|
+
var import_connect$1 = __toESM(require_connect());
|
28329
|
+
var import_lib$1 = __toESM(require_lib());
|
28330
|
+
var import_picocolors$10 = __toESM(require_picocolors());
|
28331
|
+
var import_chokidar = __toESM(require_chokidar());
|
28332
|
+
var import_launch_editor_middleware = __toESM(require_launch_editor_middleware());
|
28333
|
+
const usedConfigs = /* @__PURE__ */ new WeakSet();
|
28300
28334
|
function createServer$2(inlineConfig = {}) {
|
28301
28335
|
return _createServer(inlineConfig, { listen: true });
|
28302
28336
|
}
|
@@ -28410,7 +28444,7 @@ async function _createServer(inlineConfig = {}, options$1) {
|
|
28410
28444
|
async reloadModule(module$1) {
|
28411
28445
|
if (serverConfig.hmr !== false && module$1.file) {
|
28412
28446
|
const environmentModule = module$1._clientModule ?? module$1._ssrModule;
|
28413
|
-
updateModules(environments[environmentModule.environment], module$1.file, [environmentModule],
|
28447
|
+
updateModules(environments[environmentModule.environment], module$1.file, [environmentModule], monotonicDateNow());
|
28414
28448
|
}
|
28415
28449
|
},
|
28416
28450
|
async listen(port, isRestart) {
|
@@ -28489,7 +28523,7 @@ async function _createServer(inlineConfig = {}, options$1) {
|
|
28489
28523
|
if (serverConfig.hmr !== false) await handleHMRUpdate(type, file, server);
|
28490
28524
|
};
|
28491
28525
|
const onFileAddUnlink = async (file, isUnlink) => {
|
28492
|
-
file = normalizePath
|
28526
|
+
file = normalizePath(file);
|
28493
28527
|
reloadOnTsconfigChange(server, file);
|
28494
28528
|
await pluginContainer.watchChange(file, { event: isUnlink ? "delete" : "create" });
|
28495
28529
|
if (publicDir && publicFiles) {
|
@@ -28508,7 +28542,7 @@ async function _createServer(inlineConfig = {}, options$1) {
|
|
28508
28542
|
await onHMRUpdate(isUnlink ? "delete" : "create", file);
|
28509
28543
|
};
|
28510
28544
|
watcher.on("change", async (file) => {
|
28511
|
-
file = normalizePath
|
28545
|
+
file = normalizePath(file);
|
28512
28546
|
reloadOnTsconfigChange(server, file);
|
28513
28547
|
await pluginContainer.watchChange(file, { event: "update" });
|
28514
28548
|
for (const environment of Object.values(server.environments)) environment.moduleGraph.onFileChange(file);
|
@@ -28538,7 +28572,7 @@ async function _createServer(inlineConfig = {}, options$1) {
|
|
28538
28572
|
middlewares.use(cachedTransformMiddleware(server));
|
28539
28573
|
const { proxy } = serverConfig;
|
28540
28574
|
if (proxy) {
|
28541
|
-
const middlewareServer = (isObject
|
28575
|
+
const middlewareServer = (isObject(middlewareMode) ? middlewareMode.server : null) || httpServer;
|
28542
28576
|
middlewares.use(proxyMiddleware(middlewareServer, proxy, config$2));
|
28543
28577
|
}
|
28544
28578
|
if (config$2.base !== "/") middlewares.use(baseMiddleware(config$2.rawBase, !!middlewareMode));
|
@@ -28604,7 +28638,7 @@ async function startServer(server, inlinePort) {
|
|
28604
28638
|
function createServerCloseFn(server) {
|
28605
28639
|
if (!server) return () => Promise.resolve();
|
28606
28640
|
let hasListened = false;
|
28607
|
-
const openSockets = new Set();
|
28641
|
+
const openSockets = /* @__PURE__ */ new Set();
|
28608
28642
|
server.on("connection", (socket) => {
|
28609
28643
|
openSockets.add(socket);
|
28610
28644
|
socket.on("close", () => {
|
@@ -28624,7 +28658,7 @@ function createServerCloseFn(server) {
|
|
28624
28658
|
});
|
28625
28659
|
}
|
28626
28660
|
function resolvedAllowDir(root, dir) {
|
28627
|
-
return normalizePath
|
28661
|
+
return normalizePath(path.resolve(root, dir));
|
28628
28662
|
}
|
28629
28663
|
const serverConfigDefaults = Object.freeze({
|
28630
28664
|
port: DEFAULT_DEV_PORT,
|
@@ -28657,7 +28691,7 @@ function resolveServerOptions(root, raw, logger) {
|
|
28657
28691
|
const _server = mergeWithDefaults({
|
28658
28692
|
...serverConfigDefaults,
|
28659
28693
|
host: void 0,
|
28660
|
-
sourcemapIgnoreList: isInNodeModules
|
28694
|
+
sourcemapIgnoreList: isInNodeModules
|
28661
28695
|
}, raw ?? {});
|
28662
28696
|
const server = {
|
28663
28697
|
..._server,
|
@@ -28747,16 +28781,16 @@ async function restartServerWithUrls(server) {
|
|
28747
28781
|
|
28748
28782
|
//#endregion
|
28749
28783
|
//#region src/node/server/hmr.ts
|
28750
|
-
var import_picocolors$9 = __toESM(require_picocolors()
|
28784
|
+
var import_picocolors$9 = __toESM(require_picocolors());
|
28751
28785
|
const debugHmr = createDebugger("vite:hmr");
|
28752
28786
|
const whitespaceRE = /\s/;
|
28753
|
-
const normalizedClientDir = normalizePath
|
28787
|
+
const normalizedClientDir = normalizePath(CLIENT_DIR);
|
28754
28788
|
function getShortName(file, root) {
|
28755
28789
|
return file.startsWith(withTrailingSlash(root)) ? path.posix.relative(root, file) : file;
|
28756
28790
|
}
|
28757
28791
|
const normalizeHotChannel = (channel, enableHmr, normalizeClient = true) => {
|
28758
|
-
const normalizedListenerMap = new WeakMap();
|
28759
|
-
const listenersForEvents = new Map();
|
28792
|
+
const normalizedListenerMap = /* @__PURE__ */ new WeakMap();
|
28793
|
+
const listenersForEvents = /* @__PURE__ */ new Map();
|
28760
28794
|
let invokeHandlers;
|
28761
28795
|
let listenerForInvokeHandler;
|
28762
28796
|
const handleInvoke = async (payload) => {
|
@@ -28802,7 +28836,7 @@ const normalizeHotChannel = (channel, enableHmr, normalizeClient = true) => {
|
|
28802
28836
|
};
|
28803
28837
|
normalizedListenerMap.set(fn, listenerWithNormalizedClient);
|
28804
28838
|
channel.on?.(event, listenerWithNormalizedClient);
|
28805
|
-
if (!listenersForEvents.has(event)) listenersForEvents.set(event, new Set());
|
28839
|
+
if (!listenersForEvents.has(event)) listenersForEvents.set(event, /* @__PURE__ */ new Set());
|
28806
28840
|
listenersForEvents.get(event).add(listenerWithNormalizedClient);
|
28807
28841
|
},
|
28808
28842
|
off: (event, fn) => {
|
@@ -28880,7 +28914,7 @@ function getSortedPluginsByHotUpdateHook(plugins$1) {
|
|
28880
28914
|
}
|
28881
28915
|
return sortedPlugins;
|
28882
28916
|
}
|
28883
|
-
const sortedHotUpdatePluginsCache = new WeakMap();
|
28917
|
+
const sortedHotUpdatePluginsCache = /* @__PURE__ */ new WeakMap();
|
28884
28918
|
function getSortedHotUpdatePlugins(environment) {
|
28885
28919
|
let sortedPlugins = sortedHotUpdatePluginsCache.get(environment);
|
28886
28920
|
if (!sortedPlugins) {
|
@@ -28899,7 +28933,7 @@ async function handleHMRUpdate(type, file, server) {
|
|
28899
28933
|
const isEnv = config$2.envDir !== false && getEnvFilesForMode(config$2.mode, config$2.envDir).includes(file);
|
28900
28934
|
if (isConfig || isConfigDependency || isEnv) {
|
28901
28935
|
debugHmr?.(`[config change] ${import_picocolors$9.default.dim(shortFile)}`);
|
28902
|
-
config$2.logger.info(import_picocolors$9.default.green(`${normalizePath
|
28936
|
+
config$2.logger.info(import_picocolors$9.default.green(`${normalizePath(path.relative(process.cwd(), file))} changed, restarting server...`), {
|
28903
28937
|
clear: true,
|
28904
28938
|
timestamp: true
|
28905
28939
|
});
|
@@ -28919,7 +28953,7 @@ async function handleHMRUpdate(type, file, server) {
|
|
28919
28953
|
}));
|
28920
28954
|
return;
|
28921
28955
|
}
|
28922
|
-
const timestamp =
|
28956
|
+
const timestamp = monotonicDateNow();
|
28923
28957
|
const contextMeta = {
|
28924
28958
|
type,
|
28925
28959
|
file,
|
@@ -28927,7 +28961,7 @@ async function handleHMRUpdate(type, file, server) {
|
|
28927
28961
|
read: () => readModifiedFile(file),
|
28928
28962
|
server
|
28929
28963
|
};
|
28930
|
-
const hotMap = new Map();
|
28964
|
+
const hotMap = /* @__PURE__ */ new Map();
|
28931
28965
|
for (const environment of Object.values(server.environments)) {
|
28932
28966
|
const mods = new Set(environment.moduleGraph.getModulesByFile(file));
|
28933
28967
|
if (type === "create") for (const mod of environment.moduleGraph._hasResolveFailedErrorModules) mods.add(mod);
|
@@ -29000,7 +29034,7 @@ async function handleHMRUpdate(type, file, server) {
|
|
29000
29034
|
});
|
29001
29035
|
environment.hot.send({
|
29002
29036
|
type: "full-reload",
|
29003
|
-
path: config$2.server.middlewareMode ? "*" : "/" + normalizePath
|
29037
|
+
path: config$2.server.middlewareMode ? "*" : "/" + normalizePath(path.relative(config$2.root, file))
|
29004
29038
|
});
|
29005
29039
|
} else debugHmr?.(`(${environment.name}) [no modules matched] ${import_picocolors$9.default.dim(shortFile)}`);
|
29006
29040
|
return;
|
@@ -29021,8 +29055,8 @@ async function handleHMRUpdate(type, file, server) {
|
|
29021
29055
|
function updateModules(environment, file, modules, timestamp, firstInvalidatedBy) {
|
29022
29056
|
const { hot } = environment;
|
29023
29057
|
const updates = [];
|
29024
|
-
const invalidatedModules = new Set();
|
29025
|
-
const traversedModules = new Set();
|
29058
|
+
const invalidatedModules = /* @__PURE__ */ new Set();
|
29059
|
+
const traversedModules = /* @__PURE__ */ new Set();
|
29026
29060
|
let needFullReload = modules.length === 0;
|
29027
29061
|
for (const mod of modules) {
|
29028
29062
|
const boundaries = [];
|
@@ -29129,7 +29163,7 @@ function propagateUpdate(node, traversedModules, boundaries, currentChain = [nod
|
|
29129
29163
|
* @param currentChain The current chain tracked from the `node` parameter
|
29130
29164
|
* @param traversedModules The set of modules that have traversed
|
29131
29165
|
*/
|
29132
|
-
function isNodeWithinCircularImports(node, nodeChain, currentChain = [node], traversedModules = new Set()) {
|
29166
|
+
function isNodeWithinCircularImports(node, nodeChain, currentChain = [node], traversedModules = /* @__PURE__ */ new Set()) {
|
29133
29167
|
if (traversedModules.has(node)) return false;
|
29134
29168
|
traversedModules.add(node);
|
29135
29169
|
for (const importer of node.importers) {
|
@@ -29155,7 +29189,7 @@ function isNodeWithinCircularImports(node, nodeChain, currentChain = [node], tra
|
|
29155
29189
|
return false;
|
29156
29190
|
}
|
29157
29191
|
function handlePrunedModules(mods, { hot }) {
|
29158
|
-
const t$1 =
|
29192
|
+
const t$1 = monotonicDateNow();
|
29159
29193
|
mods.forEach((mod) => {
|
29160
29194
|
mod.lastHMRTimestamp = t$1;
|
29161
29195
|
mod.lastHMRInvalidationReceived = false;
|
@@ -29242,13 +29276,13 @@ function lexAcceptedHmrDeps(code, start, urls) {
|
|
29242
29276
|
return false;
|
29243
29277
|
}
|
29244
29278
|
function lexAcceptedHmrExports(code, start, exportNames) {
|
29245
|
-
const urls = new Set();
|
29279
|
+
const urls = /* @__PURE__ */ new Set();
|
29246
29280
|
lexAcceptedHmrDeps(code, start, urls);
|
29247
29281
|
for (const { url: url$6 } of urls) exportNames.add(url$6);
|
29248
29282
|
return urls.size > 0;
|
29249
29283
|
}
|
29250
29284
|
function normalizeHmrUrl(url$6) {
|
29251
|
-
if (url$6[0] !== "." && url$6[0] !== "/") url$6 = wrapId
|
29285
|
+
if (url$6[0] !== "." && url$6[0] !== "/") url$6 = wrapId(url$6);
|
29252
29286
|
return url$6;
|
29253
29287
|
}
|
29254
29288
|
function error(pos) {
|
@@ -29300,7 +29334,7 @@ function createServerHotChannel() {
|
|
29300
29334
|
const nonJsRe = /\.json(?:$|\?)/;
|
29301
29335
|
const isNonJsRequest = (request) => nonJsRe.test(request);
|
29302
29336
|
const importMetaEnvMarker = "__vite_import_meta_env__";
|
29303
|
-
const importMetaEnvKeyReCache = new Map();
|
29337
|
+
const importMetaEnvKeyReCache = /* @__PURE__ */ new Map();
|
29304
29338
|
function definePlugin(config$2) {
|
29305
29339
|
const isBuild = config$2.command === "build";
|
29306
29340
|
const isBuildLib = isBuild && config$2.build.lib;
|
@@ -29361,7 +29395,7 @@ function definePlugin(config$2) {
|
|
29361
29395
|
importMetaEnvVal
|
29362
29396
|
];
|
29363
29397
|
}
|
29364
|
-
const patternsCache = new WeakMap();
|
29398
|
+
const patternsCache = /* @__PURE__ */ new WeakMap();
|
29365
29399
|
function getPattern(environment) {
|
29366
29400
|
let pattern = patternsCache.get(environment);
|
29367
29401
|
if (!pattern) {
|
@@ -29468,12 +29502,12 @@ function getImportMetaEnvKeyRe(marker) {
|
|
29468
29502
|
|
29469
29503
|
//#endregion
|
29470
29504
|
//#region src/node/plugins/worker.ts
|
29471
|
-
var import_picocolors$8 = __toESM(require_picocolors()
|
29505
|
+
var import_picocolors$8 = __toESM(require_picocolors());
|
29472
29506
|
const workerOrSharedWorkerRE = /(?:\?|&)(worker|sharedworker)(?:&|$)/;
|
29473
29507
|
const workerFileRE = /(?:\?|&)worker_file&type=(\w+)(?:&|$)/;
|
29474
29508
|
const inlineRE$1 = /[?&]inline\b/;
|
29475
29509
|
const WORKER_FILE_ID = "worker_file";
|
29476
|
-
const workerCache = new WeakMap();
|
29510
|
+
const workerCache = /* @__PURE__ */ new WeakMap();
|
29477
29511
|
function saveEmitWorkerAsset(config$2, asset) {
|
29478
29512
|
const workerMap = workerCache.get(config$2.mainConfig || config$2);
|
29479
29513
|
const duplicateAsset = workerMap.assets.get(asset.fileName);
|
@@ -29591,42 +29625,12 @@ function webWorkerPlugin(config$2) {
|
|
29591
29625
|
buildStart() {
|
29592
29626
|
if (isWorker) return;
|
29593
29627
|
workerCache.set(config$2, {
|
29594
|
-
assets: new Map(),
|
29595
|
-
bundle: new Map(),
|
29596
|
-
fileNameHash: new Map()
|
29628
|
+
assets: /* @__PURE__ */ new Map(),
|
29629
|
+
bundle: /* @__PURE__ */ new Map(),
|
29630
|
+
fileNameHash: /* @__PURE__ */ new Map()
|
29597
29631
|
});
|
29598
29632
|
},
|
29599
|
-
load: { handler(id) {
|
29600
|
-
if (isBuild && workerOrSharedWorkerRE.test(id)) return "";
|
29601
|
-
} },
|
29602
|
-
shouldTransformCachedModule({ id }) {
|
29603
|
-
if (isBuild && config$2.build.watch && workerOrSharedWorkerRE.test(id)) return true;
|
29604
|
-
},
|
29605
|
-
transform: { async handler(raw, id) {
|
29606
|
-
const workerFileMatch = workerFileRE.exec(id);
|
29607
|
-
if (workerFileMatch) {
|
29608
|
-
const workerType$1 = workerFileMatch[1];
|
29609
|
-
let injectEnv = "";
|
29610
|
-
const scriptPath = JSON.stringify(path.posix.join(config$2.base, ENV_PUBLIC_PATH));
|
29611
|
-
if (workerType$1 === "classic") injectEnv = `importScripts(${scriptPath})\n`;
|
29612
|
-
else if (workerType$1 === "module") injectEnv = `import ${scriptPath}\n`;
|
29613
|
-
else if (workerType$1 === "ignore") if (isBuild) injectEnv = "";
|
29614
|
-
else {
|
29615
|
-
const environment = this.environment;
|
29616
|
-
const moduleGraph = environment.mode === "dev" ? environment.moduleGraph : void 0;
|
29617
|
-
const module$1 = moduleGraph?.getModuleById(ENV_ENTRY);
|
29618
|
-
injectEnv = module$1?.transformResult?.code || "";
|
29619
|
-
}
|
29620
|
-
if (injectEnv) {
|
29621
|
-
const s$2 = new MagicString(raw);
|
29622
|
-
s$2.prepend(injectEnv + ";\n");
|
29623
|
-
return {
|
29624
|
-
code: s$2.toString(),
|
29625
|
-
map: s$2.generateMap({ hires: "boundary" })
|
29626
|
-
};
|
29627
|
-
}
|
29628
|
-
return;
|
29629
|
-
}
|
29633
|
+
load: { async handler(id) {
|
29630
29634
|
const workerMatch = workerOrSharedWorkerRE.exec(id);
|
29631
29635
|
if (!workerMatch) return;
|
29632
29636
|
const { format: format$3 } = config$2.worker;
|
@@ -29679,7 +29683,7 @@ function webWorkerPlugin(config$2) {
|
|
29679
29683
|
url$6 = injectQuery(url$6, `${WORKER_FILE_ID}&type=${workerType}`);
|
29680
29684
|
urlCode = JSON.stringify(url$6);
|
29681
29685
|
}
|
29682
|
-
if (urlRE
|
29686
|
+
if (urlRE.test(id)) return {
|
29683
29687
|
code: `export default ${urlCode}`,
|
29684
29688
|
map: { mappings: "" }
|
29685
29689
|
};
|
@@ -29693,6 +29697,34 @@ function webWorkerPlugin(config$2) {
|
|
29693
29697
|
map: { mappings: "" }
|
29694
29698
|
};
|
29695
29699
|
} },
|
29700
|
+
shouldTransformCachedModule({ id }) {
|
29701
|
+
if (isBuild && config$2.build.watch && workerOrSharedWorkerRE.test(id)) return true;
|
29702
|
+
},
|
29703
|
+
transform: { async handler(raw, id) {
|
29704
|
+
const workerFileMatch = workerFileRE.exec(id);
|
29705
|
+
if (workerFileMatch) {
|
29706
|
+
const workerType = workerFileMatch[1];
|
29707
|
+
let injectEnv = "";
|
29708
|
+
const scriptPath = JSON.stringify(path.posix.join(config$2.base, ENV_PUBLIC_PATH));
|
29709
|
+
if (workerType === "classic") injectEnv = `importScripts(${scriptPath})\n`;
|
29710
|
+
else if (workerType === "module") injectEnv = `import ${scriptPath}\n`;
|
29711
|
+
else if (workerType === "ignore") if (isBuild) injectEnv = "";
|
29712
|
+
else {
|
29713
|
+
const environment = this.environment;
|
29714
|
+
const moduleGraph = environment.mode === "dev" ? environment.moduleGraph : void 0;
|
29715
|
+
const module$1 = moduleGraph?.getModuleById(ENV_ENTRY);
|
29716
|
+
injectEnv = module$1?.transformResult?.code || "";
|
29717
|
+
}
|
29718
|
+
if (injectEnv) {
|
29719
|
+
const s$2 = new MagicString(raw);
|
29720
|
+
s$2.prepend(injectEnv + ";\n");
|
29721
|
+
return {
|
29722
|
+
code: s$2.toString(),
|
29723
|
+
map: s$2.generateMap({ hires: "boundary" })
|
29724
|
+
};
|
29725
|
+
}
|
29726
|
+
}
|
29727
|
+
} },
|
29696
29728
|
renderChunk(code, chunk, outputOptions) {
|
29697
29729
|
let s$2;
|
29698
29730
|
const result = () => {
|
@@ -29772,7 +29804,7 @@ function preAliasPlugin(config$2) {
|
|
29772
29804
|
const optimizeDeps$1 = depsOptimizer.options;
|
29773
29805
|
const resolvedId = cleanUrl(resolved.id);
|
29774
29806
|
const isVirtual = resolvedId === id || resolvedId.includes("\0");
|
29775
|
-
if (!isVirtual && fs.existsSync(resolvedId) && !moduleListContains(optimizeDeps$1.exclude, id) && path.isAbsolute(resolvedId) && (isInNodeModules
|
29807
|
+
if (!isVirtual && fs.existsSync(resolvedId) && !moduleListContains(optimizeDeps$1.exclude, id) && path.isAbsolute(resolvedId) && (isInNodeModules(resolvedId) || optimizeDeps$1.include?.includes(id)) && isOptimizable(resolvedId, optimizeDeps$1) && (!ssr || optimizeAliasReplacementForSSR(resolvedId, optimizeDeps$1))) {
|
29776
29808
|
const optimizedInfo = depsOptimizer.registerMissingImport(id, resolvedId);
|
29777
29809
|
return { id: depsOptimizer.getOptimizedDepId(optimizedInfo) };
|
29778
29810
|
}
|
@@ -29804,9 +29836,9 @@ function getAliasPatternMatcher(entries) {
|
|
29804
29836
|
|
29805
29837
|
//#endregion
|
29806
29838
|
//#region src/node/plugins/importAnalysis.ts
|
29807
|
-
var import_picocolors$7 = __toESM(require_picocolors()
|
29839
|
+
var import_picocolors$7 = __toESM(require_picocolors());
|
29808
29840
|
const debug$2 = createDebugger("vite:import-analysis");
|
29809
|
-
const clientDir = normalizePath
|
29841
|
+
const clientDir = normalizePath(CLIENT_DIR);
|
29810
29842
|
const skipRE = /\.(?:map|json)(?:$|\?)/;
|
29811
29843
|
const canSkipImportAnalysis = (id) => skipRE.test(id) || isDirectCSSRequest(id);
|
29812
29844
|
const optimizedDepChunkRE = /\/chunk-[A-Z\d]{8}\.js/;
|
@@ -29823,13 +29855,13 @@ function normalizeResolvedIdToUrl(environment, url$6, resolved) {
|
|
29823
29855
|
if (resolved.id.startsWith(withTrailingSlash(root))) url$6 = resolved.id.slice(root.length);
|
29824
29856
|
else if (depsOptimizer?.isOptimizedDepFile(resolved.id) || resolved.id !== "/@react-refresh" && path.isAbsolute(resolved.id) && fs.existsSync(cleanUrl(resolved.id))) url$6 = path.posix.join(FS_PREFIX, resolved.id);
|
29825
29857
|
else url$6 = resolved.id;
|
29826
|
-
if (url$6[0] !== "." && url$6[0] !== "/") url$6 = wrapId
|
29858
|
+
if (url$6[0] !== "." && url$6[0] !== "/") url$6 = wrapId(resolved.id);
|
29827
29859
|
return url$6;
|
29828
29860
|
}
|
29829
29861
|
function extractImportedBindings(id, source, importSpec, importedBindings) {
|
29830
29862
|
let bindings = importedBindings.get(id);
|
29831
29863
|
if (!bindings) {
|
29832
|
-
bindings = new Set();
|
29864
|
+
bindings = /* @__PURE__ */ new Set();
|
29833
29865
|
importedBindings.set(id, bindings);
|
29834
29866
|
}
|
29835
29867
|
const isDynamic = importSpec.d > -1;
|
@@ -29918,12 +29950,12 @@ function importAnalysisPlugin(config$2) {
|
|
29918
29950
|
return null;
|
29919
29951
|
}
|
29920
29952
|
const msAtStart = debug$2 ? performance$1.now() : 0;
|
29921
|
-
await init
|
29953
|
+
await init;
|
29922
29954
|
let imports;
|
29923
29955
|
let exports$1;
|
29924
29956
|
source = stripBomTag(source);
|
29925
29957
|
try {
|
29926
|
-
[imports, exports$1] = parse
|
29958
|
+
[imports, exports$1] = parse(source);
|
29927
29959
|
} catch (_e) {
|
29928
29960
|
const e$1 = _e;
|
29929
29961
|
const { message, showCodeFrame } = createParseErrorInfo(importer, source);
|
@@ -29944,7 +29976,7 @@ function importAnalysisPlugin(config$2) {
|
|
29944
29976
|
let s$2;
|
29945
29977
|
const str = () => s$2 || (s$2 = new MagicString(source));
|
29946
29978
|
let isPartiallySelfAccepting = false;
|
29947
|
-
const importedBindings = enablePartialAccept ? new Map() : null;
|
29979
|
+
const importedBindings = enablePartialAccept ? /* @__PURE__ */ new Map() : null;
|
29948
29980
|
const toAbsoluteUrl = (url$6) => path.posix.resolve(path.posix.dirname(importerModule.url), url$6);
|
29949
29981
|
const normalizeUrl = async (url$6, pos, forceSkipImportAnalysis = false) => {
|
29950
29982
|
url$6 = stripBase(url$6, base);
|
@@ -29964,7 +29996,7 @@ function importAnalysisPlugin(config$2) {
|
|
29964
29996
|
if (ssr) return [url$6, null];
|
29965
29997
|
importerModule.isSelfAccepting = false;
|
29966
29998
|
moduleGraph._hasResolveFailedErrorModules.add(importerModule);
|
29967
|
-
return this.error(`Failed to resolve import "${url$6}" from "${normalizePath
|
29999
|
+
return this.error(`Failed to resolve import "${url$6}" from "${normalizePath(path.relative(process.cwd(), importerFile))}". Does the file exist?`, pos);
|
29968
30000
|
}
|
29969
30001
|
if (isExternalUrl(resolved.id)) return [resolved.id, resolved.id];
|
29970
30002
|
const isRelative$1 = url$6[0] === ".";
|
@@ -29978,7 +30010,7 @@ function importAnalysisPlugin(config$2) {
|
|
29978
30010
|
}
|
29979
30011
|
}
|
29980
30012
|
try {
|
29981
|
-
const depModule = await moduleGraph._ensureEntryFromUrl(unwrapId
|
30013
|
+
const depModule = await moduleGraph._ensureEntryFromUrl(unwrapId(url$6), canSkipImportAnalysis(url$6) || forceSkipImportAnalysis, resolved);
|
29982
30014
|
if (environment.config.consumer === "client" && depModule.lastHMRTimestamp > 0) url$6 = injectQuery(url$6, `t=${depModule.lastHMRTimestamp}`);
|
29983
30015
|
} catch (e$1) {
|
29984
30016
|
e$1.pos = pos;
|
@@ -30000,11 +30032,11 @@ function importAnalysisPlugin(config$2) {
|
|
30000
30032
|
hasHMR = true;
|
30001
30033
|
const endHot = end + 4 + (source[end + 4] === "?" ? 1 : 0);
|
30002
30034
|
if (source.slice(endHot, endHot + 7) === ".accept") if (source.slice(endHot, endHot + 14) === ".acceptExports") {
|
30003
|
-
const importAcceptedExports = orderedAcceptedExports[index] = new Set();
|
30035
|
+
const importAcceptedExports = orderedAcceptedExports[index] = /* @__PURE__ */ new Set();
|
30004
30036
|
lexAcceptedHmrExports(source, source.indexOf("(", endHot + 14) + 1, importAcceptedExports);
|
30005
30037
|
isPartiallySelfAccepting = true;
|
30006
30038
|
} else {
|
30007
|
-
const importAcceptedUrls = orderedAcceptedUrls[index] = new Set();
|
30039
|
+
const importAcceptedUrls = orderedAcceptedUrls[index] = /* @__PURE__ */ new Set();
|
30008
30040
|
if (lexAcceptedHmrDeps(source, source.indexOf("(", endHot + 7) + 1, importAcceptedUrls)) isSelfAccepting = true;
|
30009
30041
|
}
|
30010
30042
|
} else if (prop === ".env") hasEnv = true;
|
@@ -30021,7 +30053,7 @@ function importAnalysisPlugin(config$2) {
|
|
30021
30053
|
if (isBuiltin(environment.config.resolve.builtins, specifier)) return;
|
30022
30054
|
}
|
30023
30055
|
if (specifier === clientPublicPath) return;
|
30024
|
-
if (specifier[0] === "/" && !(config$2.assetsInclude(cleanUrl(specifier)) || urlRE
|
30056
|
+
if (specifier[0] === "/" && !(config$2.assetsInclude(cleanUrl(specifier)) || urlRE.test(specifier)) && checkPublicFile(specifier, config$2)) throw new Error(`Cannot import non-asset file ${specifier} which is inside /public. JS/CSS files inside /public are copied as-is on build and can only be referenced via <script src> or <link href> in html. If you want to get the URL of that file, use ${injectQuery(specifier, "url")} instead.`);
|
30025
30057
|
let [url$6, resolvedId] = await normalizeUrl(specifier, start);
|
30026
30058
|
resolvedId = resolvedId || url$6;
|
30027
30059
|
config$2.safeModulePaths.add(fsPathFromUrl(stripBase(url$6, base)));
|
@@ -30048,7 +30080,7 @@ function importAnalysisPlugin(config$2) {
|
|
30048
30080
|
str().overwrite(s$3, e$1, rewrittenUrl, { contentOnly: true });
|
30049
30081
|
}
|
30050
30082
|
}
|
30051
|
-
const hmrUrl = unwrapId
|
30083
|
+
const hmrUrl = unwrapId(stripBase(url$6, base));
|
30052
30084
|
const isLocalImport = !isExternalUrl(hmrUrl) && !isDataUrl(hmrUrl);
|
30053
30085
|
if (isLocalImport) orderedImportedUrls[index] = hmrUrl;
|
30054
30086
|
if (enablePartialAccept && importedBindings) extractImportedBindings(resolvedId, source, importSpecifier, importedBindings);
|
@@ -30057,7 +30089,7 @@ function importAnalysisPlugin(config$2) {
|
|
30057
30089
|
environment.warmupRequest(url$7);
|
30058
30090
|
}
|
30059
30091
|
} else if (!importer.startsWith(withTrailingSlash(clientDir))) {
|
30060
|
-
if (!isInNodeModules
|
30092
|
+
if (!isInNodeModules(importer)) {
|
30061
30093
|
const hasViteIgnore = hasViteIgnoreRE.test(source.slice(dynamicIndex + 1, end));
|
30062
30094
|
if (!hasViteIgnore) this.warn(`\n` + import_picocolors$7.default.cyan(importerModule.file) + `\n` + import_picocolors$7.default.reset(generateCodeFrame(source, start, end)) + import_picocolors$7.default.yellow(`\nThe above dynamic import cannot be analyzed by Vite.\nSee ${import_picocolors$7.default.blue(`https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations`)} for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.\n`));
|
30063
30095
|
}
|
@@ -30082,7 +30114,7 @@ function importAnalysisPlugin(config$2) {
|
|
30082
30114
|
}
|
30083
30115
|
if (needQueryInjectHelper) if (isClassicWorker) str().append("\n" + __vite__injectQuery.toString());
|
30084
30116
|
else str().prepend(`import { injectQuery as __vite__injectQuery } from "${clientPublicPath}";`);
|
30085
|
-
const normalizedAcceptedUrls = new Set();
|
30117
|
+
const normalizedAcceptedUrls = /* @__PURE__ */ new Set();
|
30086
30118
|
for (const { url: url$6, start, end } of acceptedUrls) {
|
30087
30119
|
let [normalized, resolvedId] = await normalizeUrl(url$6, start).catch(() => []);
|
30088
30120
|
if (resolvedId) {
|
@@ -30122,7 +30154,7 @@ function importAnalysisPlugin(config$2) {
|
|
30122
30154
|
};
|
30123
30155
|
}
|
30124
30156
|
function mergeAcceptedUrls(orderedUrls) {
|
30125
|
-
const acceptedUrls = new Set();
|
30157
|
+
const acceptedUrls = /* @__PURE__ */ new Set();
|
30126
30158
|
for (const urls of orderedUrls) {
|
30127
30159
|
if (!urls) continue;
|
30128
30160
|
for (const url$6 of urls) acceptedUrls.add(url$6);
|
@@ -30237,8 +30269,8 @@ function __vite__injectQuery(url$6, queryToInject) {
|
|
30237
30269
|
|
30238
30270
|
//#endregion
|
30239
30271
|
//#region src/node/plugins/clientInjections.ts
|
30240
|
-
const normalizedClientEntry = normalizePath
|
30241
|
-
const normalizedEnvEntry = normalizePath
|
30272
|
+
const normalizedClientEntry = normalizePath(CLIENT_ENTRY);
|
30273
|
+
const normalizedEnvEntry = normalizePath(ENV_ENTRY);
|
30242
30274
|
/**
|
30243
30275
|
* some values used by the client needs to be dynamically injected by the server
|
30244
30276
|
* @server-only
|
@@ -30260,7 +30292,7 @@ function clientInjectionsPlugin(config$2) {
|
|
30260
30292
|
const devBase = config$2.base;
|
30261
30293
|
const serverHost = `${resolvedServerHostname}:${resolvedServerPort}${devBase}`;
|
30262
30294
|
let hmrConfig = config$2.server.hmr;
|
30263
|
-
hmrConfig = isObject
|
30295
|
+
hmrConfig = isObject(hmrConfig) ? hmrConfig : void 0;
|
30264
30296
|
const host = hmrConfig?.host || null;
|
30265
30297
|
const protocol = hmrConfig?.protocol || null;
|
30266
30298
|
const timeout = hmrConfig?.timeout || 3e4;
|
@@ -30472,7 +30504,7 @@ function workerImportMetaUrlPlugin(config$2) {
|
|
30472
30504
|
let file;
|
30473
30505
|
if (url$6[0] === ".") {
|
30474
30506
|
file = path.resolve(path.dirname(id), url$6);
|
30475
|
-
file = slash
|
30507
|
+
file = slash(tryFsResolve(file, fsResolveOptions) ?? file);
|
30476
30508
|
} else {
|
30477
30509
|
workerResolver ??= createBackCompatIdResolver(config$2, {
|
30478
30510
|
extensions: [],
|
@@ -30480,7 +30512,7 @@ function workerImportMetaUrlPlugin(config$2) {
|
|
30480
30512
|
preferRelative: true
|
30481
30513
|
});
|
30482
30514
|
file = await workerResolver(this.environment, url$6, id);
|
30483
|
-
file ??= url$6[0] === "/" ? slash
|
30515
|
+
file ??= url$6[0] === "/" ? slash(path.join(config$2.publicDir, url$6)) : slash(path.resolve(path.dirname(id), url$6));
|
30484
30516
|
}
|
30485
30517
|
if (isBuild && config$2.isWorker && config$2.bundleChain.at(-1) === cleanUrl(file)) s$2.update(expStart, expEnd, "self.location.href");
|
30486
30518
|
else {
|
@@ -30562,7 +30594,7 @@ function assetImportMetaUrlPlugin(config$2) {
|
|
30562
30594
|
if (isDataUrl(url$6)) continue;
|
30563
30595
|
let file;
|
30564
30596
|
if (url$6[0] === ".") {
|
30565
|
-
file = slash
|
30597
|
+
file = slash(path.resolve(path.dirname(id), url$6));
|
30566
30598
|
file = tryFsResolve(file, fsResolveOptions) ?? file;
|
30567
30599
|
} else {
|
30568
30600
|
assetResolver ??= createBackCompatIdResolver(config$2, {
|
@@ -30572,7 +30604,7 @@ function assetImportMetaUrlPlugin(config$2) {
|
|
30572
30604
|
preferRelative: true
|
30573
30605
|
});
|
30574
30606
|
file = await assetResolver(this.environment, url$6, id);
|
30575
|
-
file ??= url$6[0] === "/" ? slash
|
30607
|
+
file ??= url$6[0] === "/" ? slash(path.join(publicDir, url$6)) : slash(path.resolve(path.dirname(id), url$6));
|
30576
30608
|
}
|
30577
30609
|
let builtUrl;
|
30578
30610
|
if (file) try {
|
@@ -30628,8 +30660,8 @@ function metadataPlugin() {
|
|
30628
30660
|
name: "vite:build-metadata",
|
30629
30661
|
async renderChunk(_code, chunk) {
|
30630
30662
|
chunk.viteMetadata = {
|
30631
|
-
importedAssets: new Set(),
|
30632
|
-
importedCss: new Set()
|
30663
|
+
importedAssets: /* @__PURE__ */ new Set(),
|
30664
|
+
importedCss: /* @__PURE__ */ new Set()
|
30633
30665
|
};
|
30634
30666
|
return null;
|
30635
30667
|
}
|
@@ -30718,7 +30750,7 @@ function parseDynamicImportPattern(strings) {
|
|
30718
30750
|
let globParams = null;
|
30719
30751
|
if (search) {
|
30720
30752
|
search = "?" + search;
|
30721
|
-
if (workerOrSharedWorkerRE.test(search) || urlRE
|
30753
|
+
if (workerOrSharedWorkerRE.test(search) || urlRE.test(search) || rawRE.test(search)) globParams = {
|
30722
30754
|
query: search,
|
30723
30755
|
import: "*"
|
30724
30756
|
};
|
@@ -30734,7 +30766,7 @@ async function transformDynamicImport(importSource, importer, resolve$5, root) {
|
|
30734
30766
|
if (importSource[1] !== "." && importSource[1] !== "/") {
|
30735
30767
|
const resolvedFileName = await resolve$5(importSource.slice(1, -1), importer);
|
30736
30768
|
if (!resolvedFileName) return null;
|
30737
|
-
const relativeFileName = normalizePath
|
30769
|
+
const relativeFileName = normalizePath(posix.relative(posix.dirname(normalizePath(importer)), normalizePath(resolvedFileName)));
|
30738
30770
|
importSource = "`" + (relativeFileName[0] === "." ? "" : "./") + relativeFileName + "`";
|
30739
30771
|
}
|
30740
30772
|
const dynamicImportPattern = parseDynamicImportPattern(importSource);
|
@@ -30760,7 +30792,7 @@ function dynamicImportVarsPlugin(config$2) {
|
|
30760
30792
|
});
|
30761
30793
|
const getFilter = perEnvironmentState((environment) => {
|
30762
30794
|
const { include, exclude } = environment.config.build.dynamicImportVarsOptions;
|
30763
|
-
return createFilter
|
30795
|
+
return createFilter(include, exclude);
|
30764
30796
|
});
|
30765
30797
|
return {
|
30766
30798
|
name: "vite:dynamic-import-vars",
|
@@ -30773,10 +30805,10 @@ function dynamicImportVarsPlugin(config$2) {
|
|
30773
30805
|
transform: { async handler(source, importer) {
|
30774
30806
|
const { environment } = this;
|
30775
30807
|
if (!getFilter(this)(importer) || importer === CLIENT_ENTRY || !hasDynamicImportRE.test(source)) return;
|
30776
|
-
await init
|
30808
|
+
await init;
|
30777
30809
|
let imports = [];
|
30778
30810
|
try {
|
30779
|
-
imports = parse
|
30811
|
+
imports = parse(source)[0];
|
30780
30812
|
} catch {
|
30781
30813
|
return null;
|
30782
30814
|
}
|
@@ -30811,13 +30843,13 @@ function dynamicImportVarsPlugin(config$2) {
|
|
30811
30843
|
//#endregion
|
30812
30844
|
//#region src/node/plugins/pluginFilter.ts
|
30813
30845
|
function getMatcherString(glob$1, cwd) {
|
30814
|
-
if (glob$1.startsWith("**") || path.isAbsolute(glob$1)) return slash
|
30846
|
+
if (glob$1.startsWith("**") || path.isAbsolute(glob$1)) return slash(glob$1);
|
30815
30847
|
const resolved = path.join(cwd, glob$1);
|
30816
|
-
return slash
|
30848
|
+
return slash(resolved);
|
30817
30849
|
}
|
30818
30850
|
function patternToIdFilter(pattern, cwd) {
|
30819
30851
|
if (pattern instanceof RegExp) return (id) => {
|
30820
|
-
const normalizedId = slash
|
30852
|
+
const normalizedId = slash(id);
|
30821
30853
|
const result = pattern.test(normalizedId);
|
30822
30854
|
pattern.lastIndex = 0;
|
30823
30855
|
return result;
|
@@ -30825,7 +30857,7 @@ function patternToIdFilter(pattern, cwd) {
|
|
30825
30857
|
const glob$1 = getMatcherString(pattern, cwd);
|
30826
30858
|
const matcher = picomatch(glob$1, { dot: true });
|
30827
30859
|
return (id) => {
|
30828
|
-
const normalizedId = slash
|
30860
|
+
const normalizedId = slash(id);
|
30829
30861
|
return matcher(normalizedId);
|
30830
30862
|
};
|
30831
30863
|
}
|
@@ -30837,7 +30869,7 @@ function patternToCodeFilter(pattern) {
|
|
30837
30869
|
};
|
30838
30870
|
return (code) => code.includes(pattern);
|
30839
30871
|
}
|
30840
|
-
function createFilter(exclude, include) {
|
30872
|
+
function createFilter$1(exclude, include) {
|
30841
30873
|
if (!exclude && !include) return;
|
30842
30874
|
return (input) => {
|
30843
30875
|
if (exclude?.some((filter$1) => filter$1(input))) return false;
|
@@ -30858,14 +30890,14 @@ function createIdFilter(filter$1, cwd = process.cwd()) {
|
|
30858
30890
|
const { exclude, include } = normalizeFilter(filter$1);
|
30859
30891
|
const excludeFilter = exclude?.map((p$1) => patternToIdFilter(p$1, cwd));
|
30860
30892
|
const includeFilter = include?.map((p$1) => patternToIdFilter(p$1, cwd));
|
30861
|
-
return createFilter(excludeFilter, includeFilter);
|
30893
|
+
return createFilter$1(excludeFilter, includeFilter);
|
30862
30894
|
}
|
30863
30895
|
function createCodeFilter(filter$1) {
|
30864
30896
|
if (!filter$1) return;
|
30865
30897
|
const { exclude, include } = normalizeFilter(filter$1);
|
30866
30898
|
const excludeFilter = exclude?.map(patternToCodeFilter);
|
30867
30899
|
const includeFilter = include?.map(patternToCodeFilter);
|
30868
|
-
return createFilter(excludeFilter, includeFilter);
|
30900
|
+
return createFilter$1(excludeFilter, includeFilter);
|
30869
30901
|
}
|
30870
30902
|
function createFilterForTransform(idFilter, codeFilter, cwd) {
|
30871
30903
|
if (!idFilter && !codeFilter) return;
|
@@ -30885,7 +30917,7 @@ function createFilterForTransform(idFilter, codeFilter, cwd) {
|
|
30885
30917
|
async function resolvePlugins(config$2, prePlugins, normalPlugins, postPlugins) {
|
30886
30918
|
const isBuild = config$2.command === "build";
|
30887
30919
|
const isWorker = config$2.isWorker;
|
30888
|
-
const buildPlugins = isBuild ? await (await import("./dep-
|
30920
|
+
const buildPlugins = isBuild ? await (await import("./dep-3PhSlasG.js")).resolveBuildPlugins(config$2) : {
|
30889
30921
|
pre: [],
|
30890
30922
|
post: []
|
30891
30923
|
};
|
@@ -30895,7 +30927,7 @@ async function resolvePlugins(config$2, prePlugins, normalPlugins, postPlugins)
|
|
30895
30927
|
isBuild ? metadataPlugin() : null,
|
30896
30928
|
!isWorker ? watchPackageDataPlugin(config$2.packageCache) : null,
|
30897
30929
|
!isBuild ? preAliasPlugin(config$2) : null,
|
30898
|
-
alias
|
30930
|
+
alias({
|
30899
30931
|
entries: config$2.resolve.alias,
|
30900
30932
|
customResolver: viteAliasCustomResolver
|
30901
30933
|
}),
|
@@ -30937,7 +30969,7 @@ async function resolvePlugins(config$2, prePlugins, normalPlugins, postPlugins)
|
|
30937
30969
|
].filter(Boolean);
|
30938
30970
|
}
|
30939
30971
|
function createPluginHookUtils(plugins$1) {
|
30940
|
-
const sortedPluginsCache = new Map();
|
30972
|
+
const sortedPluginsCache = /* @__PURE__ */ new Map();
|
30941
30973
|
function getSortedPlugins(hookName) {
|
30942
30974
|
if (sortedPluginsCache.has(hookName)) return sortedPluginsCache.get(hookName);
|
30943
30975
|
const sorted = getSortedPluginsByHook(hookName, plugins$1);
|
@@ -30977,7 +31009,7 @@ function getSortedPluginsByHook(hookName, plugins$1) {
|
|
30977
31009
|
function getHookHandler(hook) {
|
30978
31010
|
return typeof hook === "object" ? hook.handler : hook;
|
30979
31011
|
}
|
30980
|
-
const filterForPlugin = new WeakMap();
|
31012
|
+
const filterForPlugin = /* @__PURE__ */ new WeakMap();
|
30981
31013
|
function getCachedFilterForPlugin(plugin, hookName) {
|
30982
31014
|
let filters = filterForPlugin.get(plugin);
|
30983
31015
|
if (filters && hookName in filters) return filters[hookName];
|
@@ -31018,7 +31050,7 @@ const viteAliasCustomResolver = async function(id, importer, options$1) {
|
|
31018
31050
|
|
31019
31051
|
//#endregion
|
31020
31052
|
//#region src/node/server/pluginContainer.ts
|
31021
|
-
var import_picocolors$6 = __toESM(require_picocolors()
|
31053
|
+
var import_picocolors$6 = __toESM(require_picocolors());
|
31022
31054
|
const EMPTY_OBJECT = Object.freeze({});
|
31023
31055
|
const debugSourcemapCombineFilter = process.env.DEBUG_VITE_SOURCEMAP_COMBINE_FILTER;
|
31024
31056
|
const debugSourcemapCombine = createDebugger("vite:sourcemap-combine", { onlyWhenFocused: true });
|
@@ -31043,15 +31075,15 @@ async function createEnvironmentPluginContainer(environment, plugins$1, watcher,
|
|
31043
31075
|
return container;
|
31044
31076
|
}
|
31045
31077
|
var EnvironmentPluginContainer = class {
|
31046
|
-
_pluginContextMap = new Map();
|
31078
|
+
_pluginContextMap = /* @__PURE__ */ new Map();
|
31047
31079
|
_resolvedRollupOptions;
|
31048
|
-
_processesing = new Set();
|
31080
|
+
_processesing = /* @__PURE__ */ new Set();
|
31049
31081
|
_seenResolves = {};
|
31050
|
-
_moduleNodeToLoadAddedImports = new WeakMap();
|
31082
|
+
_moduleNodeToLoadAddedImports = /* @__PURE__ */ new WeakMap();
|
31051
31083
|
getSortedPluginHooks;
|
31052
31084
|
getSortedPlugins;
|
31053
31085
|
moduleGraph;
|
31054
|
-
watchFiles = new Set();
|
31086
|
+
watchFiles = /* @__PURE__ */ new Set();
|
31055
31087
|
minimalContext;
|
31056
31088
|
_started = false;
|
31057
31089
|
_buildStartPromise;
|
@@ -31190,7 +31222,7 @@ var EnvironmentPluginContainer = class {
|
|
31190
31222
|
}
|
31191
31223
|
}
|
31192
31224
|
if (id) {
|
31193
|
-
partial.id = isExternalUrl(id) ? id : normalizePath
|
31225
|
+
partial.id = isExternalUrl(id) ? id : normalizePath(id);
|
31194
31226
|
return partial;
|
31195
31227
|
} else return null;
|
31196
31228
|
}
|
@@ -31206,7 +31238,7 @@ var EnvironmentPluginContainer = class {
|
|
31206
31238
|
const handler = getHookHandler(plugin.load);
|
31207
31239
|
const result = await this.handleHookPromise(handler.call(ctx, id, options$1));
|
31208
31240
|
if (result != null) {
|
31209
|
-
if (isObject
|
31241
|
+
if (isObject(result)) ctx._updateModuleInfo(id, result);
|
31210
31242
|
this._updateModuleLoadAddedImports(id, ctx._addedImports);
|
31211
31243
|
return result;
|
31212
31244
|
}
|
@@ -31238,7 +31270,7 @@ var EnvironmentPluginContainer = class {
|
|
31238
31270
|
}
|
31239
31271
|
if (!result) continue;
|
31240
31272
|
debugPluginTransform?.(timeFrom(start), plugin.name, prettifyUrl(id, this.environment.config.root));
|
31241
|
-
if (isObject
|
31273
|
+
if (isObject(result)) {
|
31242
31274
|
if (result.code !== void 0) {
|
31243
31275
|
code = result.code;
|
31244
31276
|
if (result.map) {
|
@@ -31360,7 +31392,7 @@ var PluginContext = class extends MinimalPluginContext {
|
|
31360
31392
|
return out;
|
31361
31393
|
}
|
31362
31394
|
async load(options$1) {
|
31363
|
-
await this._container.moduleGraph?.ensureEntryFromUrl(unwrapId
|
31395
|
+
await this._container.moduleGraph?.ensureEntryFromUrl(unwrapId(options$1.id));
|
31364
31396
|
this._updateModuleInfo(options$1.id, options$1);
|
31365
31397
|
const loadResult = await this._container.load(options$1.id);
|
31366
31398
|
const code = typeof loadResult === "object" ? loadResult?.code : loadResult;
|
@@ -31442,7 +31474,7 @@ var PluginContext = class extends MinimalPluginContext {
|
|
31442
31474
|
if (!err$2.frame) {
|
31443
31475
|
let code = this._activeCode;
|
31444
31476
|
if (err$2.loc.file) {
|
31445
|
-
err$2.id = normalizePath
|
31477
|
+
err$2.id = normalizePath(err$2.loc.file);
|
31446
31478
|
try {
|
31447
31479
|
code = fs.readFileSync(err$2.loc.file, "utf-8");
|
31448
31480
|
} catch {}
|
@@ -31461,7 +31493,7 @@ var PluginContext = class extends MinimalPluginContext {
|
|
31461
31493
|
const rawSourceMap = this._getCombinedSourcemap();
|
31462
31494
|
if (rawSourceMap && "version" in rawSourceMap) {
|
31463
31495
|
const traced = new TraceMap(rawSourceMap);
|
31464
|
-
const { source, line, column } = originalPositionFor
|
31496
|
+
const { source, line, column } = originalPositionFor(traced, {
|
31465
31497
|
line: Number(err$2.loc.line),
|
31466
31498
|
column: Number(err$2.loc.column)
|
31467
31499
|
});
|
@@ -31476,7 +31508,7 @@ var PluginContext = class extends MinimalPluginContext {
|
|
31476
31508
|
if (!err$2.frame) {
|
31477
31509
|
let code = err$2.pluginCode;
|
31478
31510
|
if (err$2.loc.file) {
|
31479
|
-
err$2.id = normalizePath
|
31511
|
+
err$2.id = normalizePath(err$2.loc.file);
|
31480
31512
|
if (!code) try {
|
31481
31513
|
code = fs.readFileSync(err$2.loc.file, "utf-8");
|
31482
31514
|
} catch {}
|
@@ -31505,7 +31537,7 @@ var LoadPluginContext = class extends PluginContext {
|
|
31505
31537
|
super(null, container);
|
31506
31538
|
}
|
31507
31539
|
addWatchFile(id) {
|
31508
|
-
if (!this._addedImports) this._addedImports = new Set();
|
31540
|
+
if (!this._addedImports) this._addedImports = /* @__PURE__ */ new Set();
|
31509
31541
|
this._addedImports.add(id);
|
31510
31542
|
super.addWatchFile(id);
|
31511
31543
|
}
|
@@ -31662,11 +31694,11 @@ function createBackCompatIdResolver(config$2, options$1) {
|
|
31662
31694
|
*/
|
31663
31695
|
function createIdResolver(config$2, options$1) {
|
31664
31696
|
const scan = options$1?.scan;
|
31665
|
-
const pluginContainerMap = new Map();
|
31697
|
+
const pluginContainerMap = /* @__PURE__ */ new Map();
|
31666
31698
|
async function resolve$5(environment, id, importer) {
|
31667
31699
|
let pluginContainer = pluginContainerMap.get(environment);
|
31668
31700
|
if (!pluginContainer) {
|
31669
|
-
pluginContainer = await createEnvironmentPluginContainer(environment, [alias
|
31701
|
+
pluginContainer = await createEnvironmentPluginContainer(environment, [alias({ entries: environment.config.resolve.alias }), resolvePlugin({
|
31670
31702
|
root: config$2.root,
|
31671
31703
|
isProduction: config$2.isProduction,
|
31672
31704
|
isBuild: config$2.command === "build",
|
@@ -31680,11 +31712,11 @@ function createIdResolver(config$2, options$1) {
|
|
31680
31712
|
}
|
31681
31713
|
return await pluginContainer.resolveId(id, importer, { scan });
|
31682
31714
|
}
|
31683
|
-
const aliasOnlyPluginContainerMap = new Map();
|
31715
|
+
const aliasOnlyPluginContainerMap = /* @__PURE__ */ new Map();
|
31684
31716
|
async function resolveAlias(environment, id, importer) {
|
31685
31717
|
let pluginContainer = aliasOnlyPluginContainerMap.get(environment);
|
31686
31718
|
if (!pluginContainer) {
|
31687
|
-
pluginContainer = await createEnvironmentPluginContainer(environment, [alias
|
31719
|
+
pluginContainer = await createEnvironmentPluginContainer(environment, [alias({ entries: environment.config.resolve.alias })], void 0, false);
|
31688
31720
|
aliasOnlyPluginContainerMap.set(environment, pluginContainer);
|
31689
31721
|
}
|
31690
31722
|
return await pluginContainer.resolveId(id, importer, { scan });
|
@@ -31698,8 +31730,8 @@ function createIdResolver(config$2, options$1) {
|
|
31698
31730
|
|
31699
31731
|
//#endregion
|
31700
31732
|
//#region src/node/plugins/css.ts
|
31701
|
-
var import_src = __toESM(require_src()
|
31702
|
-
var import_picocolors$5 = __toESM(require_picocolors()
|
31733
|
+
var import_src = __toESM(require_src());
|
31734
|
+
var import_picocolors$5 = __toESM(require_picocolors());
|
31703
31735
|
const decoder = new TextDecoder();
|
31704
31736
|
const cssConfigDefaults = Object.freeze({
|
31705
31737
|
transformer: "postcss",
|
@@ -31741,10 +31773,10 @@ var PostCssDialectLang = /* @__PURE__ */ function(PostCssDialectLang$1) {
|
|
31741
31773
|
const isModuleCSSRequest = (request) => cssModuleRE.test(request);
|
31742
31774
|
const isDirectCSSRequest = (request) => CSS_LANGS_RE.test(request) && directRequestRE.test(request);
|
31743
31775
|
const isDirectRequest = (request) => directRequestRE.test(request);
|
31744
|
-
const cssModulesCache = new WeakMap();
|
31745
|
-
const removedPureCssFilesCache = new WeakMap();
|
31746
|
-
const cssBundleNameCache = new WeakMap();
|
31747
|
-
const postcssConfigCache = new WeakMap();
|
31776
|
+
const cssModulesCache = /* @__PURE__ */ new WeakMap();
|
31777
|
+
const removedPureCssFilesCache = /* @__PURE__ */ new WeakMap();
|
31778
|
+
const cssBundleNameCache = /* @__PURE__ */ new WeakMap();
|
31779
|
+
const postcssConfigCache = /* @__PURE__ */ new WeakMap();
|
31748
31780
|
function encodePublicUrlsInCSS(config$2) {
|
31749
31781
|
return config$2.command === "build";
|
31750
31782
|
}
|
@@ -31765,9 +31797,9 @@ function cssPlugin(config$2) {
|
|
31765
31797
|
return {
|
31766
31798
|
name: "vite:css",
|
31767
31799
|
buildStart() {
|
31768
|
-
moduleCache = new Map();
|
31800
|
+
moduleCache = /* @__PURE__ */ new Map();
|
31769
31801
|
cssModulesCache.set(config$2, moduleCache);
|
31770
|
-
removedPureCssFilesCache.set(config$2, new Map());
|
31802
|
+
removedPureCssFilesCache.set(config$2, /* @__PURE__ */ new Map());
|
31771
31803
|
preprocessorWorkerController = createPreprocessorWorkerController(normalizeMaxWorkers(config$2.css.preprocessorMaxWorkers));
|
31772
31804
|
preprocessorWorkerControllerCache.set(config$2, preprocessorWorkerController);
|
31773
31805
|
},
|
@@ -31776,7 +31808,7 @@ function cssPlugin(config$2) {
|
|
31776
31808
|
},
|
31777
31809
|
load: { async handler(id) {
|
31778
31810
|
if (!isCSSRequest(id)) return;
|
31779
|
-
if (urlRE
|
31811
|
+
if (urlRE.test(id)) {
|
31780
31812
|
if (isModuleCSSRequest(id)) throw new Error(`?url is not supported with CSS modules. (tried to import ${JSON.stringify(id)})`);
|
31781
31813
|
if (isBuild) {
|
31782
31814
|
id = injectQuery(removeUrlQuery(id), "transform-only");
|
@@ -31818,7 +31850,7 @@ function cssPlugin(config$2) {
|
|
31818
31850
|
* Plugin applied after user plugins
|
31819
31851
|
*/
|
31820
31852
|
function cssPostPlugin(config$2) {
|
31821
|
-
const styles = new Map();
|
31853
|
+
const styles = /* @__PURE__ */ new Map();
|
31822
31854
|
let codeSplitEmitQueue = createSerialPromiseQueue();
|
31823
31855
|
const urlEmitQueue = createSerialPromiseQueue();
|
31824
31856
|
let pureCssChunks;
|
@@ -31849,9 +31881,9 @@ function cssPostPlugin(config$2) {
|
|
31849
31881
|
return {
|
31850
31882
|
name: "vite:css-post",
|
31851
31883
|
renderStart() {
|
31852
|
-
pureCssChunks = new Set();
|
31884
|
+
pureCssChunks = /* @__PURE__ */ new Set();
|
31853
31885
|
hasEmitted = false;
|
31854
|
-
chunkCSSMap = new Map();
|
31886
|
+
chunkCSSMap = /* @__PURE__ */ new Map();
|
31855
31887
|
codeSplitEmitQueue = createSerialPromiseQueue();
|
31856
31888
|
},
|
31857
31889
|
transform: { async handler(css, id) {
|
@@ -31935,9 +31967,9 @@ function cssPostPlugin(config$2) {
|
|
31935
31967
|
const resolveAssetUrlsInCss = (chunkCSS$1, cssAssetName) => {
|
31936
31968
|
const encodedPublicUrls = encodePublicUrlsInCSS(config$2);
|
31937
31969
|
const relative$3 = config$2.base === "./" || config$2.base === "";
|
31938
|
-
const cssAssetDirname = encodedPublicUrls || relative$3 ? slash
|
31970
|
+
const cssAssetDirname = encodedPublicUrls || relative$3 ? slash(getCssAssetDirname(cssAssetName)) : void 0;
|
31939
31971
|
const toRelative = (filename) => {
|
31940
|
-
const relativePath = normalizePath
|
31972
|
+
const relativePath = normalizePath(path.relative(cssAssetDirname, filename));
|
31941
31973
|
return relativePath[0] === "." ? relativePath : "./" + relativePath;
|
31942
31974
|
};
|
31943
31975
|
chunkCSS$1 = chunkCSS$1.replace(assetUrlRE, (_, fileHash, postfix = "") => {
|
@@ -31946,7 +31978,7 @@ function cssPostPlugin(config$2) {
|
|
31946
31978
|
return encodeURIPath(toOutputFilePathInCss(filename, "asset", cssAssetName, "css", config$2, toRelative));
|
31947
31979
|
});
|
31948
31980
|
if (encodedPublicUrls) {
|
31949
|
-
const relativePathToPublicFromCSS = normalizePath
|
31981
|
+
const relativePathToPublicFromCSS = normalizePath(path.relative(cssAssetDirname, ""));
|
31950
31982
|
chunkCSS$1 = chunkCSS$1.replace(publicAssetUrlRE, (_, hash$1) => {
|
31951
31983
|
const publicUrl = publicAssetUrlMap.get(hash$1).slice(1);
|
31952
31984
|
return encodeURIPath(toOutputFilePathInCss(publicUrl, "public", cssAssetName, "css", config$2, () => `${relativePathToPublicFromCSS}/${publicUrl}`));
|
@@ -31955,7 +31987,7 @@ function cssPostPlugin(config$2) {
|
|
31955
31987
|
return chunkCSS$1;
|
31956
31988
|
};
|
31957
31989
|
function ensureFileExt(name, ext) {
|
31958
|
-
return normalizePath
|
31990
|
+
return normalizePath(path.format({
|
31959
31991
|
...path.parse(name),
|
31960
31992
|
base: void 0,
|
31961
31993
|
ext
|
@@ -32065,8 +32097,8 @@ function cssPostPlugin(config$2) {
|
|
32065
32097
|
if (opts.__vite_skip_asset_emit__) return;
|
32066
32098
|
if (!this.environment.config.build.cssCodeSplit && !hasEmitted) {
|
32067
32099
|
let extractedCss = "";
|
32068
|
-
const collected = new Set();
|
32069
|
-
const dynamicImports = new Set();
|
32100
|
+
const collected = /* @__PURE__ */ new Set();
|
32101
|
+
const dynamicImports = /* @__PURE__ */ new Set();
|
32070
32102
|
function collect(chunk) {
|
32071
32103
|
if (!chunk || chunk.type !== "chunk" || collected.has(chunk)) return;
|
32072
32104
|
collected.add(chunk);
|
@@ -32131,14 +32163,14 @@ function cssAnalysisPlugin(config$2) {
|
|
32131
32163
|
const isSelfAccepting = !cssModulesCache.get(config$2)?.get(id) && !inlineRE.test(id) && !htmlProxyRE.test(id);
|
32132
32164
|
const pluginImports = this._addedImports;
|
32133
32165
|
if (pluginImports) {
|
32134
|
-
const depModules = new Set();
|
32166
|
+
const depModules = /* @__PURE__ */ new Set();
|
32135
32167
|
for (const file of pluginImports) if (isCSSRequest(file)) depModules.add(moduleGraph.createFileOnlyEntry(file));
|
32136
32168
|
else {
|
32137
32169
|
const url$6 = await fileToDevUrl(this.environment, file, true);
|
32138
32170
|
if (url$6.startsWith("data:")) depModules.add(moduleGraph.createFileOnlyEntry(file));
|
32139
32171
|
else depModules.add(await moduleGraph.ensureEntryFromUrl(url$6));
|
32140
32172
|
}
|
32141
|
-
moduleGraph.updateModuleInfo(thisModule, depModules, null, new Set(), null, isSelfAccepting);
|
32173
|
+
moduleGraph.updateModuleInfo(thisModule, depModules, null, /* @__PURE__ */ new Set(), null, isSelfAccepting);
|
32142
32174
|
} else thisModule.isSelfAccepting = isSelfAccepting;
|
32143
32175
|
}
|
32144
32176
|
} }
|
@@ -32197,7 +32229,7 @@ function createCSSResolvers(config$2) {
|
|
32197
32229
|
preferRelative: true
|
32198
32230
|
});
|
32199
32231
|
sassResolve = async (...args) => {
|
32200
|
-
if (args[1].startsWith("file://")) args[1] = fileURLToPath(args[1], { windows: isWindows
|
32232
|
+
if (args[1].startsWith("file://")) args[1] = fileURLToPath(args[1], { windows: isWindows && !fileURLWithWindowsDriveRE.test(args[1]) ? false : void 0 });
|
32201
32233
|
return resolver(...args);
|
32202
32234
|
};
|
32203
32235
|
}
|
@@ -32235,8 +32267,8 @@ async function compileCSSPreprocessors(environment, id, lang, code, workerContro
|
|
32235
32267
|
if (preprocessResult.error) throw preprocessResult.error;
|
32236
32268
|
let deps;
|
32237
32269
|
if (preprocessResult.deps.length > 0) {
|
32238
|
-
const normalizedFilename = normalizePath
|
32239
|
-
deps = new Set([...preprocessResult.deps].filter((dep) => normalizePath
|
32270
|
+
const normalizedFilename = normalizePath(opts.filename);
|
32271
|
+
deps = new Set([...preprocessResult.deps].filter((dep) => normalizePath(dep) !== normalizedFilename));
|
32240
32272
|
}
|
32241
32273
|
return {
|
32242
32274
|
code: preprocessResult.code,
|
@@ -32244,7 +32276,7 @@ async function compileCSSPreprocessors(environment, id, lang, code, workerContro
|
|
32244
32276
|
deps
|
32245
32277
|
};
|
32246
32278
|
}
|
32247
|
-
const configToAtImportResolvers = new WeakMap();
|
32279
|
+
const configToAtImportResolvers = /* @__PURE__ */ new WeakMap();
|
32248
32280
|
function getAtImportResolvers(config$2) {
|
32249
32281
|
let atImportResolvers = configToAtImportResolvers.get(config$2);
|
32250
32282
|
if (!atImportResolvers) {
|
@@ -32256,7 +32288,7 @@ function getAtImportResolvers(config$2) {
|
|
32256
32288
|
async function compileCSS(environment, id, code, workerController, urlResolver) {
|
32257
32289
|
const { config: config$2 } = environment;
|
32258
32290
|
const lang = CSS_LANGS_RE.exec(id)?.[1];
|
32259
|
-
const deps = new Set();
|
32291
|
+
const deps = /* @__PURE__ */ new Set();
|
32260
32292
|
let preprocessorMap;
|
32261
32293
|
if (isPreProcessor(lang)) {
|
32262
32294
|
const preprocessorResult = await compileCSSPreprocessors(environment, id, lang, code, workerController);
|
@@ -32367,7 +32399,7 @@ async function runPostCSS(id, code, plugins$1, options$1, deps, logger, enableSo
|
|
32367
32399
|
sourcesContent: true
|
32368
32400
|
} } : {}
|
32369
32401
|
});
|
32370
|
-
for (const message of postcssResult.messages) if (message.type === "dependency") deps?.add(normalizePath
|
32402
|
+
for (const message of postcssResult.messages) if (message.type === "dependency") deps?.add(normalizePath(message.file));
|
32371
32403
|
else if (message.type === "dir-dependency") {
|
32372
32404
|
const { dir, glob: globPattern = "**" } = message;
|
32373
32405
|
const files = globSync(globPattern, {
|
@@ -32420,10 +32452,10 @@ function createCachedImport(imp) {
|
|
32420
32452
|
return cached;
|
32421
32453
|
};
|
32422
32454
|
}
|
32423
|
-
const importPostcssImport = createCachedImport(() => import("./dep-
|
32424
|
-
const importPostcssModules = createCachedImport(() => import("./dep-
|
32455
|
+
const importPostcssImport = createCachedImport(() => import("./dep-uSUFJk9A.js"));
|
32456
|
+
const importPostcssModules = createCachedImport(() => import("./dep-Dg4W3IAQ.js"));
|
32425
32457
|
const importPostcss = createCachedImport(() => import("postcss"));
|
32426
|
-
const preprocessorWorkerControllerCache = new WeakMap();
|
32458
|
+
const preprocessorWorkerControllerCache = /* @__PURE__ */ new WeakMap();
|
32427
32459
|
let alwaysFakeWorkerWorkerControllerCache;
|
32428
32460
|
/**
|
32429
32461
|
* @experimental
|
@@ -32442,7 +32474,7 @@ async function formatPostcssSourceMap(rawMap, file) {
|
|
32442
32474
|
const sources = rawMap.sources.map((source) => {
|
32443
32475
|
const cleanSource = cleanUrl(decodeURIComponent(source));
|
32444
32476
|
if (cleanSource[0] === "<" && cleanSource.endsWith(">")) return `\0${cleanSource}`;
|
32445
|
-
return normalizePath
|
32477
|
+
return normalizePath(path.resolve(inputFileDir, cleanSource));
|
32446
32478
|
});
|
32447
32479
|
return {
|
32448
32480
|
file,
|
@@ -32470,7 +32502,7 @@ async function resolvePostcssConfig(config$2) {
|
|
32470
32502
|
let result = postcssConfigCache.get(config$2);
|
32471
32503
|
if (result !== void 0) return await result;
|
32472
32504
|
const inlineOptions = config$2.css.postcss;
|
32473
|
-
if (isObject
|
32505
|
+
if (isObject(inlineOptions)) {
|
32474
32506
|
const options$1 = { ...inlineOptions };
|
32475
32507
|
delete options$1.plugins;
|
32476
32508
|
result = {
|
@@ -32814,7 +32846,7 @@ const scssProcessor = (maxWorkers) => {
|
|
32814
32846
|
const result = await worker.run(sassPackage.path, data, optionsWithoutAdditionalData);
|
32815
32847
|
const deps = result.stats.includedFiles.map((f$1) => cleanScssBugUrl(f$1));
|
32816
32848
|
const map$1 = result.map ? JSON.parse(result.map.toString()) : void 0;
|
32817
|
-
if (map$1) map$1.sources = map$1.sources.map((url$6) => url$6.startsWith("file://") ? normalizePath
|
32849
|
+
if (map$1) map$1.sources = map$1.sources.map((url$6) => url$6.startsWith("file://") ? normalizePath(fileURLToPath(url$6)) : url$6);
|
32818
32850
|
return {
|
32819
32851
|
code: result.css.toString(),
|
32820
32852
|
map: map$1,
|
@@ -32859,7 +32891,7 @@ async function rebaseUrls(environment, file, rootFile, resolver, ignoreUrl) {
|
|
32859
32891
|
if (unquotedUrl[0] === "/") return unquotedUrl;
|
32860
32892
|
const absolute = await resolver(environment, unquotedUrl, file) || path.resolve(fileDir, unquotedUrl);
|
32861
32893
|
const relative$3 = path.relative(rootDir, absolute);
|
32862
|
-
return normalizePath
|
32894
|
+
return normalizePath(relative$3);
|
32863
32895
|
};
|
32864
32896
|
if (hasImportCss) rebased = await rewriteImportCss(content, rebaseFn);
|
32865
32897
|
if (hasUrls) rebased = await rewriteCssUrls(rebased || content, rebaseFn);
|
@@ -33056,7 +33088,7 @@ const stylProcessor = (maxWorkers) => {
|
|
33056
33088
|
function formatStylusSourceMap(mapBefore, root) {
|
33057
33089
|
if (!mapBefore) return void 0;
|
33058
33090
|
const map$1 = { ...mapBefore };
|
33059
|
-
const resolveFromRoot = (p$1) => normalizePath
|
33091
|
+
const resolveFromRoot = (p$1) => normalizePath(path.resolve(root, p$1));
|
33060
33092
|
if (map$1.file) map$1.file = resolveFromRoot(map$1.file);
|
33061
33093
|
map$1.sources = map$1.sources.map(resolveFromRoot);
|
33062
33094
|
return map$1;
|
@@ -33323,7 +33355,7 @@ const esMap = {
|
|
33323
33355
|
};
|
33324
33356
|
const esRE = /es(\d{4})/;
|
33325
33357
|
const versionRE = /\d/;
|
33326
|
-
const convertTargetsCache = new Map();
|
33358
|
+
const convertTargetsCache = /* @__PURE__ */ new Map();
|
33327
33359
|
const convertTargets = (esbuildTarget) => {
|
33328
33360
|
if (!esbuildTarget) return {};
|
33329
33361
|
const cached = convertTargetsCache.get(esbuildTarget);
|
@@ -33367,7 +33399,7 @@ function resolveLibCssFilename(libOptions, root, packageCache) {
|
|
33367
33399
|
|
33368
33400
|
//#endregion
|
33369
33401
|
//#region src/node/plugins/importAnalysisBuild.ts
|
33370
|
-
var import_convert_source_map = __toESM(require_convert_source_map()
|
33402
|
+
var import_convert_source_map = __toESM(require_convert_source_map());
|
33371
33403
|
/**
|
33372
33404
|
* A flag for injected helpers. This flag will be set to `false` if the output
|
33373
33405
|
* target is not native es - so that injected helper logic can be conditionally
|
@@ -33379,7 +33411,7 @@ const preloadMarker = `__VITE_PRELOAD__`;
|
|
33379
33411
|
const preloadHelperId = "\0vite/preload-helper.js";
|
33380
33412
|
const preloadMarkerRE = new RegExp(preloadMarker, "g");
|
33381
33413
|
const dynamicImportPrefixRE = /import\s*\(/;
|
33382
|
-
const dynamicImportTreeshakenRE = /((?:\bconst\s+|\blet\s+|\bvar\s+|,\s*)(\{[^{}.=]+\})\s*=\s*await\s+import\([^)]+\))|(\(\s*await\s+import\([^)]+\)\s*\)(\??\.[\w$]+))|\bimport\([^)]+\)(\s*\.then\(\s*(?:function\s*)?\(\s*\{([^{}.=]+)\}\))/g;
|
33414
|
+
const dynamicImportTreeshakenRE = /((?:\bconst\s+|\blet\s+|\bvar\s+|,\s*)(\{[^{}.=]+\})\s*=\s*await\s+import\([^)]+\))(?=\s*(?:$|[^[.]))|(\(\s*await\s+import\([^)]+\)\s*\)(\??\.[\w$]+))|\bimport\([^)]+\)(\s*\.then\(\s*(?:function\s*)?\(\s*\{([^{}.=]+)\}\))/g;
|
33383
33415
|
function toRelativePath(filename, importer) {
|
33384
33416
|
const relPath = path.posix.relative(path.posix.dirname(importer), filename);
|
33385
33417
|
return relPath[0] === "." ? relPath : `./${relPath}`;
|
@@ -33476,11 +33508,11 @@ function buildImportAnalysisPlugin(config$2) {
|
|
33476
33508
|
}
|
33477
33509
|
} },
|
33478
33510
|
transform: { async handler(source, importer) {
|
33479
|
-
if (
|
33480
|
-
await init
|
33511
|
+
if (!dynamicImportPrefixRE.test(source)) return;
|
33512
|
+
await init;
|
33481
33513
|
let imports = [];
|
33482
33514
|
try {
|
33483
|
-
imports = parse
|
33515
|
+
imports = parse(source)[0];
|
33484
33516
|
} catch (_e) {
|
33485
33517
|
const e$1 = _e;
|
33486
33518
|
const { message, showCodeFrame } = createParseErrorInfo(importer, source);
|
@@ -33560,7 +33592,7 @@ function buildImportAnalysisPlugin(config$2) {
|
|
33560
33592
|
const code = chunk.code;
|
33561
33593
|
let imports;
|
33562
33594
|
try {
|
33563
|
-
imports = parse
|
33595
|
+
imports = parse(code)[0].filter((i$1) => i$1.d > -1);
|
33564
33596
|
} catch (e$1) {
|
33565
33597
|
const loc = numberToPos(code, e$1.idx);
|
33566
33598
|
this.error({
|
@@ -33599,7 +33631,7 @@ function buildImportAnalysisPlugin(config$2) {
|
|
33599
33631
|
const code = chunk.code;
|
33600
33632
|
let imports;
|
33601
33633
|
try {
|
33602
|
-
imports = parse
|
33634
|
+
imports = parse(code)[0].filter((i$1) => i$1.d > -1);
|
33603
33635
|
} catch (e$1) {
|
33604
33636
|
const loc = numberToPos(code, e$1.idx);
|
33605
33637
|
this.error({
|
@@ -33616,7 +33648,7 @@ function buildImportAnalysisPlugin(config$2) {
|
|
33616
33648
|
});
|
33617
33649
|
}
|
33618
33650
|
const s$2 = new MagicString(code);
|
33619
|
-
const rewroteMarkerStartPos = new Set();
|
33651
|
+
const rewroteMarkerStartPos = /* @__PURE__ */ new Set();
|
33620
33652
|
const fileDeps = [];
|
33621
33653
|
const addFileDep = (url$6, runtime = false) => {
|
33622
33654
|
const index = fileDeps.findIndex((dep) => dep.url === url$6);
|
@@ -33633,13 +33665,13 @@ function buildImportAnalysisPlugin(config$2) {
|
|
33633
33665
|
const rawUrl = code.slice(start, end);
|
33634
33666
|
if (rawUrl[0] === `"` && rawUrl.endsWith(`"`)) url$6 = rawUrl.slice(1, -1);
|
33635
33667
|
}
|
33636
|
-
const deps = new Set();
|
33668
|
+
const deps = /* @__PURE__ */ new Set();
|
33637
33669
|
let hasRemovedPureCssChunk = false;
|
33638
33670
|
let normalizedFile = void 0;
|
33639
33671
|
if (url$6) {
|
33640
33672
|
normalizedFile = path.posix.join(path.posix.dirname(chunk.fileName), url$6);
|
33641
33673
|
const ownerFilename = chunk.fileName;
|
33642
|
-
const analyzed = new Set();
|
33674
|
+
const analyzed = /* @__PURE__ */ new Set();
|
33643
33675
|
const addDeps = (filename) => {
|
33644
33676
|
if (filename === ownerFilename) return;
|
33645
33677
|
if (analyzed.has(filename)) return;
|
@@ -33751,7 +33783,7 @@ function ssrManifestPlugin() {
|
|
33751
33783
|
const chunk = bundle[file];
|
33752
33784
|
if (chunk.type === "chunk") {
|
33753
33785
|
for (const id in chunk.modules) {
|
33754
|
-
const normalizedId = normalizePath
|
33786
|
+
const normalizedId = normalizePath(relative(config$2.root, id));
|
33755
33787
|
const mappedChunks = ssrManifest[normalizedId] ?? (ssrManifest[normalizedId] = []);
|
33756
33788
|
if (!chunk.isEntry) {
|
33757
33789
|
mappedChunks.push(joinUrlSegments(base, chunk.fileName));
|
@@ -33767,7 +33799,7 @@ function ssrManifestPlugin() {
|
|
33767
33799
|
const code = chunk.code;
|
33768
33800
|
let imports = [];
|
33769
33801
|
try {
|
33770
|
-
imports = parse
|
33802
|
+
imports = parse(code)[0].filter((i$1) => i$1.n && i$1.d > -1);
|
33771
33803
|
} catch (_e) {
|
33772
33804
|
const e$1 = _e;
|
33773
33805
|
const loc = numberToPos(code, e$1.idx);
|
@@ -33789,7 +33821,7 @@ function ssrManifestPlugin() {
|
|
33789
33821
|
const url$6 = code.slice(start, end);
|
33790
33822
|
const deps = [];
|
33791
33823
|
const ownerFilename = chunk.fileName;
|
33792
|
-
const analyzed = new Set();
|
33824
|
+
const analyzed = /* @__PURE__ */ new Set();
|
33793
33825
|
const addDeps = (filename) => {
|
33794
33826
|
if (filename === ownerFilename) return;
|
33795
33827
|
if (analyzed.has(filename)) return;
|
@@ -33802,7 +33834,7 @@ function ssrManifestPlugin() {
|
|
33802
33834
|
chunk$1.imports.forEach(addDeps);
|
33803
33835
|
}
|
33804
33836
|
};
|
33805
|
-
const normalizedFile = normalizePath
|
33837
|
+
const normalizedFile = normalizePath(join(dirname(chunk.fileName), url$6.slice(1, -1)));
|
33806
33838
|
addDeps(normalizedFile);
|
33807
33839
|
ssrManifest[basename(name)] = deps;
|
33808
33840
|
}
|
@@ -33861,7 +33893,7 @@ function completeSystemWrapPlugin() {
|
|
33861
33893
|
|
33862
33894
|
//#endregion
|
33863
33895
|
//#region src/node/build.ts
|
33864
|
-
var import_picocolors$4 = __toESM(require_picocolors()
|
33896
|
+
var import_picocolors$4 = __toESM(require_picocolors());
|
33865
33897
|
const buildEnvironmentOptionsDefaults = Object.freeze({
|
33866
33898
|
target: "baseline-widely-available",
|
33867
33899
|
polyfillModulePreload: true,
|
@@ -33963,8 +33995,7 @@ function resolveConfigToBuild(inlineConfig = {}, patchConfig, patchPlugins) {
|
|
33963
33995
|
* Build an App environment, or a App library (if libraryOptions is provided)
|
33964
33996
|
**/
|
33965
33997
|
async function buildEnvironment(environment) {
|
33966
|
-
const { root, packageCache } = environment.config;
|
33967
|
-
const options$1 = environment.config.build;
|
33998
|
+
const { root, packageCache, build: options$1 } = environment.config;
|
33968
33999
|
const libOptions = options$1.lib;
|
33969
34000
|
const { logger } = environment;
|
33970
34001
|
const ssr = environment.config.consumer === "server";
|
@@ -34370,8 +34401,8 @@ function toOutputFilePathWithoutRuntime(filename, type, hostId, hostType, config
|
|
34370
34401
|
const toOutputFilePathInCss = toOutputFilePathWithoutRuntime;
|
34371
34402
|
const toOutputFilePathInHtml = toOutputFilePathWithoutRuntime;
|
34372
34403
|
function areSeparateFolders(a, b) {
|
34373
|
-
const na = normalizePath
|
34374
|
-
const nb = normalizePath
|
34404
|
+
const na = normalizePath(a);
|
34405
|
+
const nb = normalizePath(b);
|
34375
34406
|
return na !== nb && !na.startsWith(withTrailingSlash(nb)) && !nb.startsWith(withTrailingSlash(na));
|
34376
34407
|
}
|
34377
34408
|
var BuildEnvironment = class extends BaseEnvironment {
|
@@ -34522,7 +34553,7 @@ async function fetchModule(environment, url$6, importer, options$1 = {}) {
|
|
34522
34553
|
type
|
34523
34554
|
};
|
34524
34555
|
}
|
34525
|
-
url$6 = unwrapId
|
34556
|
+
url$6 = unwrapId(url$6);
|
34526
34557
|
const mod = await environment.moduleGraph.ensureEntryFromUrl(url$6);
|
34527
34558
|
const cached = !!mod.transformResult;
|
34528
34559
|
if (options$1.cached && cached) return { cache: true };
|
@@ -34552,7 +34583,7 @@ function inlineSourceMap(mod, result, startOffset) {
|
|
34552
34583
|
|
34553
34584
|
//#endregion
|
34554
34585
|
//#region src/node/optimizer/optimizer.ts
|
34555
|
-
var import_picocolors$3 = __toESM(require_picocolors()
|
34586
|
+
var import_picocolors$3 = __toESM(require_picocolors());
|
34556
34587
|
const debug$1 = createDebugger("vite:deps");
|
34557
34588
|
/**
|
34558
34589
|
* The amount to wait for requests to register newly found dependencies before triggering
|
@@ -34937,9 +34968,9 @@ var EnvironmentModuleNode = class {
|
|
34937
34968
|
type;
|
34938
34969
|
info;
|
34939
34970
|
meta;
|
34940
|
-
importers = new Set();
|
34941
|
-
importedModules = new Set();
|
34942
|
-
acceptedHmrDeps = new Set();
|
34971
|
+
importers = /* @__PURE__ */ new Set();
|
34972
|
+
importedModules = /* @__PURE__ */ new Set();
|
34973
|
+
acceptedHmrDeps = /* @__PURE__ */ new Set();
|
34943
34974
|
acceptedHmrExports = null;
|
34944
34975
|
importedBindings = null;
|
34945
34976
|
isSelfAccepting;
|
@@ -34985,20 +35016,20 @@ var EnvironmentModuleNode = class {
|
|
34985
35016
|
};
|
34986
35017
|
var EnvironmentModuleGraph = class {
|
34987
35018
|
environment;
|
34988
|
-
urlToModuleMap = new Map();
|
34989
|
-
idToModuleMap = new Map();
|
34990
|
-
etagToModuleMap = new Map();
|
34991
|
-
fileToModulesMap = new Map();
|
35019
|
+
urlToModuleMap = /* @__PURE__ */ new Map();
|
35020
|
+
idToModuleMap = /* @__PURE__ */ new Map();
|
35021
|
+
etagToModuleMap = /* @__PURE__ */ new Map();
|
35022
|
+
fileToModulesMap = /* @__PURE__ */ new Map();
|
34992
35023
|
/**
|
34993
35024
|
* @internal
|
34994
35025
|
*/
|
34995
|
-
_unresolvedUrlToModuleMap = new Map();
|
35026
|
+
_unresolvedUrlToModuleMap = /* @__PURE__ */ new Map();
|
34996
35027
|
/**
|
34997
35028
|
* @internal
|
34998
35029
|
*/
|
34999
35030
|
_resolveId;
|
35000
35031
|
/** @internal */
|
35001
|
-
_hasResolveFailedErrorModules = new Set();
|
35032
|
+
_hasResolveFailedErrorModules = /* @__PURE__ */ new Set();
|
35002
35033
|
constructor(environment, resolveId) {
|
35003
35034
|
this.environment = environment;
|
35004
35035
|
this._resolveId = resolveId;
|
@@ -35019,7 +35050,7 @@ var EnvironmentModuleGraph = class {
|
|
35019
35050
|
onFileChange(file) {
|
35020
35051
|
const mods = this.getModulesByFile(file);
|
35021
35052
|
if (mods) {
|
35022
|
-
const seen$1 = new Set();
|
35053
|
+
const seen$1 = /* @__PURE__ */ new Set();
|
35023
35054
|
mods.forEach((mod) => {
|
35024
35055
|
this.invalidateModule(mod, seen$1);
|
35025
35056
|
});
|
@@ -35033,7 +35064,7 @@ var EnvironmentModuleGraph = class {
|
|
35033
35064
|
});
|
35034
35065
|
});
|
35035
35066
|
}
|
35036
|
-
invalidateModule(mod, seen$1 = new Set(), timestamp =
|
35067
|
+
invalidateModule(mod, seen$1 = /* @__PURE__ */ new Set(), timestamp = monotonicDateNow(), isHmr = false, softInvalidate = false) {
|
35037
35068
|
const prevInvalidationState = mod.invalidationState;
|
35038
35069
|
if (softInvalidate) mod.invalidationState ??= mod.transformResult ?? "HARD_INVALIDATED";
|
35039
35070
|
else mod.invalidationState = "HARD_INVALIDATED";
|
@@ -35057,8 +35088,8 @@ var EnvironmentModuleGraph = class {
|
|
35057
35088
|
this._hasResolveFailedErrorModules.delete(mod);
|
35058
35089
|
}
|
35059
35090
|
invalidateAll() {
|
35060
|
-
const timestamp =
|
35061
|
-
const seen$1 = new Set();
|
35091
|
+
const timestamp = monotonicDateNow();
|
35092
|
+
const seen$1 = /* @__PURE__ */ new Set();
|
35062
35093
|
this.idToModuleMap.forEach((mod) => {
|
35063
35094
|
this.invalidateModule(mod, seen$1, timestamp);
|
35064
35095
|
});
|
@@ -35095,7 +35126,7 @@ var EnvironmentModuleGraph = class {
|
|
35095
35126
|
prevImports.forEach((dep) => {
|
35096
35127
|
if (!mod.importedModules.has(dep)) {
|
35097
35128
|
dep.importers.delete(mod);
|
35098
|
-
if (!dep.importers.size) (noLongerImported || (noLongerImported = new Set())).add(dep);
|
35129
|
+
if (!dep.importers.size) (noLongerImported || (noLongerImported = /* @__PURE__ */ new Set())).add(dep);
|
35099
35130
|
}
|
35100
35131
|
});
|
35101
35132
|
resolvePromises = [];
|
@@ -35137,7 +35168,7 @@ var EnvironmentModuleGraph = class {
|
|
35137
35168
|
const file = mod.file = cleanUrl(resolvedId);
|
35138
35169
|
let fileMappedModules = this.fileToModulesMap.get(file);
|
35139
35170
|
if (!fileMappedModules) {
|
35140
|
-
fileMappedModules = new Set();
|
35171
|
+
fileMappedModules = /* @__PURE__ */ new Set();
|
35141
35172
|
this.fileToModulesMap.set(file, fileMappedModules);
|
35142
35173
|
}
|
35143
35174
|
fileMappedModules.add(mod);
|
@@ -35149,10 +35180,10 @@ var EnvironmentModuleGraph = class {
|
|
35149
35180
|
return modPromise;
|
35150
35181
|
}
|
35151
35182
|
createFileOnlyEntry(file) {
|
35152
|
-
file = normalizePath
|
35183
|
+
file = normalizePath(file);
|
35153
35184
|
let fileMappedModules = this.fileToModulesMap.get(file);
|
35154
35185
|
if (!fileMappedModules) {
|
35155
|
-
fileMappedModules = new Set();
|
35186
|
+
fileMappedModules = /* @__PURE__ */ new Set();
|
35156
35187
|
this.fileToModulesMap.set(file, fileMappedModules);
|
35157
35188
|
}
|
35158
35189
|
const url$6 = `${FS_PREFIX}${file}`;
|
@@ -35218,7 +35249,7 @@ var EnvironmentModuleGraph = class {
|
|
35218
35249
|
|
35219
35250
|
//#endregion
|
35220
35251
|
//#region src/node/server/warmup.ts
|
35221
|
-
var import_picocolors$2 = __toESM(require_picocolors()
|
35252
|
+
var import_picocolors$2 = __toESM(require_picocolors());
|
35222
35253
|
function warmupFiles(server, environment) {
|
35223
35254
|
const { root } = server.config;
|
35224
35255
|
mapFiles(environment.config.dev.warmup, root).then((files) => {
|
@@ -35245,12 +35276,12 @@ async function warmupFile(server, environment, file) {
|
|
35245
35276
|
function htmlFileToUrl(file, root) {
|
35246
35277
|
const url$6 = path.relative(root, file);
|
35247
35278
|
if (url$6[0] === ".") return;
|
35248
|
-
return "/" + normalizePath
|
35279
|
+
return "/" + normalizePath(url$6);
|
35249
35280
|
}
|
35250
35281
|
function fileToUrl(file, root) {
|
35251
35282
|
const url$6 = path.relative(root, file);
|
35252
|
-
if (url$6[0] === ".") return path.posix.join(FS_PREFIX, normalizePath
|
35253
|
-
return "/" + normalizePath
|
35283
|
+
if (url$6[0] === ".") return path.posix.join(FS_PREFIX, normalizePath(file));
|
35284
|
+
return "/" + normalizePath(url$6);
|
35254
35285
|
}
|
35255
35286
|
async function mapFiles(files, root) {
|
35256
35287
|
if (!files.length) return [];
|
@@ -35270,7 +35301,7 @@ async function mapFiles(files, root) {
|
|
35270
35301
|
|
35271
35302
|
//#endregion
|
35272
35303
|
//#region src/node/server/environment.ts
|
35273
|
-
var import_picocolors$1 = __toESM(require_picocolors()
|
35304
|
+
var import_picocolors$1 = __toESM(require_picocolors());
|
35274
35305
|
var DevEnvironment = class extends BaseEnvironment {
|
35275
35306
|
mode = "dev";
|
35276
35307
|
moduleGraph;
|
@@ -35312,7 +35343,7 @@ var DevEnvironment = class extends BaseEnvironment {
|
|
35312
35343
|
if (!options$1) throw new Error(`Environment "${name}" is not defined in the config.`);
|
35313
35344
|
if (context.options) options$1 = mergeConfig(options$1, context.options);
|
35314
35345
|
super(name, config$2, options$1);
|
35315
|
-
this._pendingRequests = new Map();
|
35346
|
+
this._pendingRequests = /* @__PURE__ */ new Map();
|
35316
35347
|
this.moduleGraph = new EnvironmentModuleGraph(name, (url$6) => this.pluginContainer.resolveId(url$6, void 0));
|
35317
35348
|
this._crawlEndFinder = setupOnCrawlEnd();
|
35318
35349
|
this._remoteRunnerOptions = context.remoteRunner ?? {};
|
@@ -35355,7 +35386,7 @@ var DevEnvironment = class extends BaseEnvironment {
|
|
35355
35386
|
});
|
35356
35387
|
}
|
35357
35388
|
async reloadModule(module$1) {
|
35358
|
-
if (this.config.server.hmr !== false && module$1.file) updateModules(this, module$1.file, [module$1],
|
35389
|
+
if (this.config.server.hmr !== false && module$1.file) updateModules(this, module$1.file, [module$1], monotonicDateNow());
|
35359
35390
|
}
|
35360
35391
|
transformRequest(url$6) {
|
35361
35392
|
return transformRequest(this, url$6);
|
@@ -35412,8 +35443,8 @@ function invalidateModule(environment, m$2) {
|
|
35412
35443
|
}
|
35413
35444
|
const callCrawlEndIfIdleAfterMs = 50;
|
35414
35445
|
function setupOnCrawlEnd() {
|
35415
|
-
const registeredIds = new Set();
|
35416
|
-
const seenIds = new Set();
|
35446
|
+
const registeredIds = /* @__PURE__ */ new Set();
|
35447
|
+
const seenIds = /* @__PURE__ */ new Set();
|
35417
35448
|
const onCrawlEndPromiseWithResolvers = promiseWithResolvers();
|
35418
35449
|
let timeoutHandle;
|
35419
35450
|
let cancelled = false;
|
@@ -35501,7 +35532,7 @@ function getChunkSize(chunk, enc) {
|
|
35501
35532
|
* @param {import('./index.d.mts').Options} [options]
|
35502
35533
|
* @returns {import('./index.d.mts').Middleware}
|
35503
35534
|
*/
|
35504
|
-
function build_default({ threshold = 1024, level = -1, brotli = false, gzip: gzip$1 = true, mimes: mimes$1 = MIMES } = {}) {
|
35535
|
+
function build_default$1({ threshold = 1024, level = -1, brotli = false, gzip: gzip$1 = true, mimes: mimes$1 = MIMES } = {}) {
|
35505
35536
|
const brotliOpts = typeof brotli === "object" && brotli || {};
|
35506
35537
|
const gzipOpts = typeof gzip$1 === "object" && gzip$1 || {};
|
35507
35538
|
if (!zlib.createBrotliCompress) brotli = false;
|
@@ -35571,8 +35602,8 @@ function build_default({ threshold = 1024, level = -1, brotli = false, gzip: gzi
|
|
35571
35602
|
|
35572
35603
|
//#endregion
|
35573
35604
|
//#region src/node/preview.ts
|
35574
|
-
var import_connect = __toESM(require_connect()
|
35575
|
-
var import_lib = __toESM(require_lib()
|
35605
|
+
var import_connect = __toESM(require_connect());
|
35606
|
+
var import_lib = __toESM(require_lib());
|
35576
35607
|
function resolvePreviewOptions(preview$1, server) {
|
35577
35608
|
return {
|
35578
35609
|
port: preview$1?.port ?? DEFAULT_PREVIEW_PORT,
|
@@ -35645,10 +35676,10 @@ async function preview(inlineConfig = {}) {
|
|
35645
35676
|
if (allowedHosts !== true && !config$2.preview.https) app.use(hostValidationMiddleware(allowedHosts, true));
|
35646
35677
|
const { proxy } = config$2.preview;
|
35647
35678
|
if (proxy) app.use(proxyMiddleware(httpServer, proxy, config$2));
|
35648
|
-
app.use(build_default());
|
35679
|
+
app.use(build_default$1());
|
35649
35680
|
if (config$2.base !== "/") app.use(baseMiddleware(config$2.rawBase, false));
|
35650
35681
|
const headers = config$2.preview.headers;
|
35651
|
-
const viteAssetMiddleware = (...args) => build_default
|
35682
|
+
const viteAssetMiddleware = (...args) => build_default(distDir, {
|
35652
35683
|
etag: true,
|
35653
35684
|
dev: true,
|
35654
35685
|
extensions: [],
|
@@ -35741,7 +35772,7 @@ async function runnerImport(moduleId, inlineConfig) {
|
|
35741
35772
|
|
35742
35773
|
//#endregion
|
35743
35774
|
//#region src/node/config.ts
|
35744
|
-
var import_picocolors = __toESM(require_picocolors()
|
35775
|
+
var import_picocolors = __toESM(require_picocolors());
|
35745
35776
|
const debug = createDebugger("vite:config", { depth: 10 });
|
35746
35777
|
const promisifiedRealpath = promisify(fs.realpath);
|
35747
35778
|
const SYMBOL_RESOLVED_CONFIG = Symbol("vite:resolved-config");
|
@@ -35834,7 +35865,7 @@ const configDefaults = Object.freeze({
|
|
35834
35865
|
function resolveDevEnvironmentOptions(dev, environmentName, consumer, preTransformRequest$1) {
|
35835
35866
|
const resolved = mergeWithDefaults({
|
35836
35867
|
...configDefaults.dev,
|
35837
|
-
sourcemapIgnoreList: isInNodeModules
|
35868
|
+
sourcemapIgnoreList: isInNodeModules,
|
35838
35869
|
preTransformRequests: preTransformRequest$1 ?? consumer === "client",
|
35839
35870
|
createEnvironment: environmentName === "client" ? defaultCreateClientDevEnvironment : defaultCreateDevEnvironment,
|
35840
35871
|
recoverable: consumer === "client",
|
@@ -35897,10 +35928,10 @@ function checkBadCharactersInPath(name, path$13, logger) {
|
|
35897
35928
|
}
|
35898
35929
|
const clientAlias = [{
|
35899
35930
|
find: /^\/?@vite\/env/,
|
35900
|
-
replacement: path.posix.join(FS_PREFIX, normalizePath
|
35931
|
+
replacement: path.posix.join(FS_PREFIX, normalizePath(ENV_ENTRY))
|
35901
35932
|
}, {
|
35902
35933
|
find: /^\/?@vite\/client/,
|
35903
|
-
replacement: path.posix.join(FS_PREFIX, normalizePath
|
35934
|
+
replacement: path.posix.join(FS_PREFIX, normalizePath(CLIENT_ENTRY))
|
35904
35935
|
}];
|
35905
35936
|
/**
|
35906
35937
|
* alias and preserveSymlinks are not per-environment options, but they are
|
@@ -35941,7 +35972,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
35941
35972
|
let configFileDependencies = [];
|
35942
35973
|
let mode = inlineConfig.mode || defaultMode;
|
35943
35974
|
const isNodeEnvSet = !!process.env.NODE_ENV;
|
35944
|
-
const packageCache = new Map();
|
35975
|
+
const packageCache = /* @__PURE__ */ new Map();
|
35945
35976
|
if (!isNodeEnvSet) process.env.NODE_ENV = defaultNodeEnv;
|
35946
35977
|
const configEnv = {
|
35947
35978
|
mode,
|
@@ -35991,7 +36022,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
35991
36022
|
allowClearScreen: config$2.clearScreen,
|
35992
36023
|
customLogger: config$2.customLogger
|
35993
36024
|
});
|
35994
|
-
const resolvedRoot = normalizePath
|
36025
|
+
const resolvedRoot = normalizePath(config$2.root ? path.resolve(config$2.root) : process.cwd());
|
35995
36026
|
checkBadCharactersInPath("The project root", resolvedRoot, logger);
|
35996
36027
|
const configEnvironmentsClient = config$2.environments.client;
|
35997
36028
|
configEnvironmentsClient.dev ??= {};
|
@@ -36062,7 +36093,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
36062
36093
|
};
|
36063
36094
|
const ssr = resolveSSROptions(patchedConfigSsr, resolvedDefaultResolve.preserveSymlinks);
|
36064
36095
|
let envDir = config$2.envFile === false ? false : config$2.envDir;
|
36065
|
-
if (envDir !== false) envDir = config$2.envDir ? normalizePath
|
36096
|
+
if (envDir !== false) envDir = config$2.envDir ? normalizePath(path.resolve(resolvedRoot, config$2.envDir)) : resolvedRoot;
|
36066
36097
|
const userEnv = loadEnv(mode, envDir, resolveEnvPrefix(config$2));
|
36067
36098
|
const userNodeEnv = process.env.VITE_USER_NODE_ENV;
|
36068
36099
|
if (!isNodeEnvSet && userNodeEnv) if (userNodeEnv === "development") process.env.NODE_ENV = "development";
|
@@ -36071,10 +36102,10 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
36071
36102
|
const relativeBaseShortcut = config$2.base === "" || config$2.base === "./";
|
36072
36103
|
const resolvedBase = relativeBaseShortcut ? !isBuild || config$2.build?.ssr ? "/" : "./" : resolveBaseUrl(config$2.base, isBuild, logger);
|
36073
36104
|
const pkgDir = findNearestPackageData(resolvedRoot, packageCache)?.dir;
|
36074
|
-
const cacheDir = normalizePath
|
36075
|
-
const assetsFilter = config$2.assetsInclude && (!Array.isArray(config$2.assetsInclude) || config$2.assetsInclude.length) ? createFilter
|
36105
|
+
const cacheDir = normalizePath(config$2.cacheDir ? path.resolve(resolvedRoot, config$2.cacheDir) : pkgDir ? path.join(pkgDir, `node_modules/.vite`) : path.join(resolvedRoot, `.vite`));
|
36106
|
+
const assetsFilter = config$2.assetsInclude && (!Array.isArray(config$2.assetsInclude) || config$2.assetsInclude.length) ? createFilter(config$2.assetsInclude) : () => false;
|
36076
36107
|
const { publicDir } = config$2;
|
36077
|
-
const resolvedPublicDir = publicDir !== false && publicDir !== "" ? normalizePath
|
36108
|
+
const resolvedPublicDir = publicDir !== false && publicDir !== "" ? normalizePath(path.resolve(resolvedRoot, typeof publicDir === "string" ? publicDir : configDefaults.publicDir)) : "";
|
36078
36109
|
const server = resolveServerOptions(resolvedRoot, config$2.server, logger);
|
36079
36110
|
const builder = resolveBuilderOptions(config$2.builder);
|
36080
36111
|
const BASE_URL = resolvedBase;
|
@@ -36106,6 +36137,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
36106
36137
|
bundleChain
|
36107
36138
|
};
|
36108
36139
|
workerResolved.plugins = await resolvePlugins(workerResolved, workerPrePlugins, workerNormalPlugins, workerPostPlugins);
|
36140
|
+
await Promise.all(createPluginHookUtils(workerResolved.plugins).getSortedPluginHooks("configResolved").map((hook) => hook.call(resolvedConfigContext, workerResolved)));
|
36109
36141
|
workerResolved.environments = {
|
36110
36142
|
...workerResolved.environments,
|
36111
36143
|
client: {
|
@@ -36113,7 +36145,6 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
36113
36145
|
plugins: await resolveEnvironmentPlugins(new PartialEnvironment("client", workerResolved))
|
36114
36146
|
}
|
36115
36147
|
};
|
36116
|
-
await Promise.all(createPluginHookUtils(workerResolved.plugins).getSortedPluginHooks("configResolved").map((hook) => hook.call(resolvedConfigContext, workerResolved)));
|
36117
36148
|
return workerResolved;
|
36118
36149
|
};
|
36119
36150
|
const resolvedWorkerOptions = {
|
@@ -36127,8 +36158,8 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
36127
36158
|
if (Array.isArray(server.allowedHosts)) server.allowedHosts.push(...additionalAllowedHosts);
|
36128
36159
|
if (Array.isArray(preview$1.allowedHosts)) preview$1.allowedHosts.push(...additionalAllowedHosts);
|
36129
36160
|
resolved = {
|
36130
|
-
configFile: configFile ? normalizePath
|
36131
|
-
configFileDependencies: configFileDependencies.map((name) => normalizePath
|
36161
|
+
configFile: configFile ? normalizePath(configFile) : void 0,
|
36162
|
+
configFileDependencies: configFileDependencies.map((name) => normalizePath(path.resolve(name))),
|
36132
36163
|
inlineConfig,
|
36133
36164
|
root: resolvedRoot,
|
36134
36165
|
base,
|
@@ -36192,7 +36223,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
36192
36223
|
nocase: true,
|
36193
36224
|
dot: true
|
36194
36225
|
}),
|
36195
|
-
safeModulePaths: new Set(),
|
36226
|
+
safeModulePaths: /* @__PURE__ */ new Set(),
|
36196
36227
|
[SYMBOL_RESOLVED_CONFIG]: true
|
36197
36228
|
};
|
36198
36229
|
resolved = {
|
@@ -36204,8 +36235,8 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
36204
36235
|
patchPlugins?.(resolvedPlugins);
|
36205
36236
|
resolved.plugins = resolvedPlugins;
|
36206
36237
|
Object.assign(resolved, createPluginHookUtils(resolved.plugins));
|
36207
|
-
for (const name of Object.keys(resolved.environments)) resolved.environments[name].plugins = await resolveEnvironmentPlugins(new PartialEnvironment(name, resolved));
|
36208
36238
|
await Promise.all(resolved.getSortedPluginHooks("configResolved").map((hook) => hook.call(resolvedConfigContext, resolved)));
|
36239
|
+
for (const name of Object.keys(resolved.environments)) resolved.environments[name].plugins = await resolveEnvironmentPlugins(new PartialEnvironment(name, resolved));
|
36209
36240
|
optimizeDepsDisabledBackwardCompatibility(resolved, resolved.optimizeDeps);
|
36210
36241
|
optimizeDepsDisabledBackwardCompatibility(resolved, resolved.ssr.optimizeDeps, "ssr.");
|
36211
36242
|
if (resolved.environments.ssr) resolved.environments.ssr.build.emitAssets = resolved.build.ssrEmitAssets || resolved.build.emitAssets;
|
@@ -36232,7 +36263,7 @@ assetFileNames isn't equal for every build.rollupOptions.output. A single patter
|
|
36232
36263
|
(!) Experimental legacy.buildSsrCjsExternalHeuristics and ssr.format were be removed in Vite 5.
|
36233
36264
|
The only SSR Output format is ESM. Find more information at https://github.com/vitejs/vite/discussions/13816.
|
36234
36265
|
`));
|
36235
|
-
const resolvedBuildOutDir = normalizePath
|
36266
|
+
const resolvedBuildOutDir = normalizePath(path.resolve(resolved.root, resolved.build.outDir));
|
36236
36267
|
if (isParentDirectory(resolvedBuildOutDir, resolved.root) || resolvedBuildOutDir === resolved.root) resolved.logger.warn(import_picocolors.default.yellow(`
|
36237
36268
|
(!) build.outDir must not be the same directory of root or a parent directory of root as this could cause Vite to overwriting source files with build outputs.
|
36238
36269
|
`));
|
@@ -36298,9 +36329,9 @@ async function loadConfigFromFile(configEnv, configFile, configRoot = process.cw
|
|
36298
36329
|
const { configExport, dependencies } = await resolver(resolvedPath);
|
36299
36330
|
debug?.(`config file loaded in ${getTime()}`);
|
36300
36331
|
const config$2 = await (typeof configExport === "function" ? configExport(configEnv) : configExport);
|
36301
|
-
if (!isObject
|
36332
|
+
if (!isObject(config$2)) throw new Error(`config must export or return an object.`);
|
36302
36333
|
return {
|
36303
|
-
path: normalizePath
|
36334
|
+
path: normalizePath(resolvedPath),
|
36304
36335
|
config: config$2,
|
36305
36336
|
dependencies
|
36306
36337
|
};
|
@@ -36361,7 +36392,7 @@ async function bundleConfigFile(fileName, isESM) {
|
|
36361
36392
|
plugins: [{
|
36362
36393
|
name: "externalize-deps",
|
36363
36394
|
setup(build$3) {
|
36364
|
-
const packageCache = new Map();
|
36395
|
+
const packageCache = /* @__PURE__ */ new Map();
|
36365
36396
|
const resolveByViteResolver = (id, importer, isRequire$1) => {
|
36366
36397
|
return tryNodeResolve(id, importer, {
|
36367
36398
|
root: path.dirname(fileName),
|
@@ -36514,4 +36545,4 @@ function optimizeDepsDisabledBackwardCompatibility(resolved, optimizeDeps$1, opt
|
|
36514
36545
|
}
|
36515
36546
|
|
36516
36547
|
//#endregion
|
36517
|
-
export { BuildEnvironment, DevEnvironment, _createServer, addManuallyIncludedOptimizeDeps, addOptimizedDepInfo, build$1 as build, buildEnvironmentOptionsDefaults, buildErrorMessage, builderOptionsDefaults, cleanupDepsCacheStaleDirs, createBuilder, createFilter
|
36548
|
+
export { BuildEnvironment, DevEnvironment, _createServer, addManuallyIncludedOptimizeDeps, addOptimizedDepInfo, build$1 as build, buildEnvironmentOptionsDefaults, buildErrorMessage, builderOptionsDefaults, cleanupDepsCacheStaleDirs, createBuilder, createFilter, createIdResolver, createIsOptimizedDepFile, createIsOptimizedDepUrl, createLogger, createRunnableDevEnvironment, createServer$2 as createServer, createServerCloseFn, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, createToImportMetaURLBasedRelativeRuntime, defineConfig, depsFromOptimizedDepInfo, depsLogString, discoverProjectDependencies, extractExportsData, fetchModule, formatPostcssSourceMap, getDepsCacheDir, getOptimizedDepPath, initDepsOptimizerMetadata, injectEnvironmentToHooks, isCSSRequest, isDepOptimizationDisabled, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadCachedDepOptimizationMetadata, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, normalizePath, onRollupLog, optimizeDeps, optimizeExplicitEnvironmentDeps, optimizedDepInfoFromFile, optimizedDepInfoFromId, optimizedDepNeedsInterop, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, require_picocolors, resolveBuildEnvironmentOptions, resolveBuildOutputs, resolveBuildPlugins, resolveBuilderOptions, resolveConfig, resolveEnvPrefix, resolveLibFilename, resolvePreviewOptions, resolveServerOptions, resolveUserExternal, restartServerWithUrls, rollupVersion, runOptimizeDeps, runnerImport, searchForWorkspaceRoot, send, serverConfigDefaults, sortUserPlugins, ssrTransform, toDiscoveredDependencies, toOutputFilePathInCss, toOutputFilePathInHtml, toOutputFilePathInJS, toOutputFilePathWithoutRuntime, transformWithEsbuild };
|