vite 7.0.0-beta.0 → 7.0.0-beta.2
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-CCzsqxOh.js → dep-8cccGkwy.js} +51 -51
- package/dist/node/chunks/{dep-RiwDEHuV.js → dep-BO5GbxpL.js} +3 -3
- package/dist/node/chunks/{dep-FHYvcJhE.js → dep-BYhaRSbV.js} +22 -22
- package/dist/node/chunks/{dep-3jlWaCfC.js → dep-B_m28uIY.js} +1 -1
- package/dist/node/chunks/{dep-bvBD1i2C.js → dep-Bkc4tc5S.js} +627 -592
- package/dist/node/chunks/{dep-P8c3Tybu.js → dep-C5h9brB_.js} +1 -1
- package/dist/node/chunks/{dep-D_UgUiRQ.js → dep-CZ6VYVb7.js} +1 -1
- package/dist/node/chunks/{dep-Ccq9jQdz.js → dep-DZ1Lk4oF.js} +1 -1
- package/dist/node/chunks/{dep-D5HXLrlI.js → dep-DmY5m86w.js} +1 -1
- package/dist/node/chunks/{dep-B4i1tHPo.js → dep-Drtntmtt.js} +2 -1
- 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 +11 -12
- package/types/importGlob.d.ts +4 -0
- package/types/internal/cssPreprocessorOptions.d.ts +3 -3
@@ -1,5 +1,5 @@
|
|
1
1
|
import { createRequire as ___createRequire } from 'module'; const require = ___createRequire(import.meta.url);
|
2
|
-
import { __commonJS, __toESM } from "./dep-
|
2
|
+
import { __commonJS, __toDynamicImportESM, __toESM } from "./dep-Drtntmtt.js";
|
3
3
|
import { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, CSS_LANGS_RE, DEFAULT_ASSETS_INLINE_LIMIT, DEFAULT_ASSETS_RE, DEFAULT_CLIENT_CONDITIONS, DEFAULT_CLIENT_MAIN_FIELDS, DEFAULT_CONFIG_FILES, DEFAULT_DEV_PORT, DEFAULT_PREVIEW_PORT, DEFAULT_SERVER_CONDITIONS, DEFAULT_SERVER_MAIN_FIELDS, DEP_VERSION_RE, DEV_PROD_CONDITION, ENV_ENTRY, ENV_PUBLIC_PATH, ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR, ERR_OPTIMIZE_DEPS_PROCESSING_ERROR, ESBUILD_BASELINE_WIDELY_AVAILABLE_TARGET, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, METADATA_FILENAME, OPTIMIZABLE_ENTRY_RE, ROLLUP_HOOKS, SPECIAL_QUERY_RE, VERSION, VITE_PACKAGE_DIR, defaultAllowedOrigins, loopbackHosts, wildcardHosts } from "./dep-Ctugieod.js";
|
4
4
|
import { builtinModules, createRequire } from "node:module";
|
5
5
|
import { parseAst, parseAstAsync } from "rollup/parseAst";
|
@@ -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
|
}
|
@@ -2238,7 +2238,7 @@ function traverseBetweenDirs(longerDir, shorterDir, cb) {
|
|
2238
2238
|
//#region src/node/utils.ts
|
2239
2239
|
var import_picocolors$33 = __toESM(require_picocolors(), 1);
|
2240
2240
|
var import_node = __toESM(require_node$1(), 1);
|
2241
|
-
const createFilter
|
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
|
}
|
@@ -4153,10 +4171,10 @@ var require_is_reference = __commonJS({ "../../node_modules/.pnpm/is-reference@1
|
|
4153
4171
|
} });
|
4154
4172
|
|
4155
4173
|
//#endregion
|
4156
|
-
//#region ../../node_modules/.pnpm/@rollup+plugin-commonjs@28.0.
|
4157
|
-
var import_commondir = __toESM(require_commondir());
|
4158
|
-
var import_is_reference = __toESM(require_is_reference());
|
4159
|
-
var version$1 = "28.0.
|
4174
|
+
//#region ../../node_modules/.pnpm/@rollup+plugin-commonjs@28.0.5_rollup@4.40.1/node_modules/@rollup/plugin-commonjs/dist/es/index.js
|
4175
|
+
var import_commondir = __toESM(require_commondir(), 1);
|
4176
|
+
var import_is_reference = __toESM(require_is_reference(), 1);
|
4177
|
+
var version$1 = "28.0.5";
|
4160
4178
|
var peerDependencies = { rollup: "^2.68.0||^3.0.0||^4.0.0" };
|
4161
4179
|
function tryParse(parse$16, code, id) {
|
4162
4180
|
try {
|
@@ -4266,12 +4284,12 @@ 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);
|
4274
|
-
for (const path$13 of new fdir().withBasePath().withDirs().glob(isNegated ? pattern.substr(1) : pattern).crawl().sync().sort((a, b) => a.localeCompare(b, "en"))) {
|
4292
|
+
for (const path$13 of new fdir().withBasePath().withDirs().glob(isNegated ? pattern.substr(1) : pattern).crawl(relative$1(".", dynamicRequireRoot)).sync().sort((a, b) => a.localeCompare(b, "en"))) {
|
4275
4293
|
const resolvedPath = resolve$1(path$13);
|
4276
4294
|
const requirePath = normalizePathSlashes(resolvedPath);
|
4277
4295
|
if (isDirectory$1(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";
|
@@ -4426,7 +4444,11 @@ export function getAugmentedNamespace(n) {
|
|
4426
4444
|
var f = n.default;
|
4427
4445
|
if (typeof f == "function") {
|
4428
4446
|
var a = function a () {
|
4429
|
-
|
4447
|
+
var isInstance = false;
|
4448
|
+
try {
|
4449
|
+
isInstance = this instanceof a;
|
4450
|
+
} catch {}
|
4451
|
+
if (isInstance) {
|
4430
4452
|
return Reflect.construct(f, arguments, this.constructor);
|
4431
4453
|
}
|
4432
4454
|
return f.apply(this, arguments);
|
@@ -4508,7 +4530,7 @@ function resolveExtensions(importee, importer, extensions$1) {
|
|
4508
4530
|
return void 0;
|
4509
4531
|
}
|
4510
4532
|
function getResolveId(extensions$1, isPossibleCjsId) {
|
4511
|
-
const currentlyResolving = new Map();
|
4533
|
+
const currentlyResolving = /* @__PURE__ */ new Map();
|
4512
4534
|
return {
|
4513
4535
|
currentlyResolving,
|
4514
4536
|
async resolveId(importee, importer, resolveOptions) {
|
@@ -4523,7 +4545,7 @@ function getResolveId(extensions$1, isPossibleCjsId) {
|
|
4523
4545
|
});
|
4524
4546
|
return null;
|
4525
4547
|
}
|
4526
|
-
if (isWrappedId(importee, WRAPPED_SUFFIX)) return unwrapId(importee, WRAPPED_SUFFIX);
|
4548
|
+
if (isWrappedId(importee, WRAPPED_SUFFIX)) return unwrapId$1(importee, WRAPPED_SUFFIX);
|
4527
4549
|
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
4550
|
if (importer) {
|
4529
4551
|
if (importer === DYNAMIC_MODULES_ID || isWrappedId(importer, PROXY_SUFFIX) || isWrappedId(importer, ES_IMPORT_SUFFIX) || importer.endsWith(ENTRY_SUFFIX)) return importee;
|
@@ -4548,7 +4570,7 @@ function getResolveId(extensions$1, isPossibleCjsId) {
|
|
4548
4570
|
return resolved.id + ENTRY_SUFFIX;
|
4549
4571
|
}
|
4550
4572
|
if (isCommonJS === IS_WRAPPED_COMMONJS) return {
|
4551
|
-
id: wrapId(resolved.id, ES_IMPORT_SUFFIX),
|
4573
|
+
id: wrapId$1(resolved.id, ES_IMPORT_SUFFIX),
|
4552
4574
|
meta: { commonjs: { resolved } }
|
4553
4575
|
};
|
4554
4576
|
}
|
@@ -4562,7 +4584,7 @@ function getRequireResolver(extensions$1, detectCyclesAndConditional, currentlyR
|
|
4562
4584
|
const requiredIds = Object.create(null);
|
4563
4585
|
const unconditionallyRequiredIds = Object.create(null);
|
4564
4586
|
const dependencies = Object.create(null);
|
4565
|
-
const getDependencies = (id) => dependencies[id] || (dependencies[id] = new Set());
|
4587
|
+
const getDependencies = (id) => dependencies[id] || (dependencies[id] = /* @__PURE__ */ new Set());
|
4566
4588
|
const isCyclic = (id) => {
|
4567
4589
|
const dependenciesToCheck = new Set(getDependencies(id));
|
4568
4590
|
for (const dependency of dependenciesToCheck) {
|
@@ -4621,7 +4643,7 @@ function getRequireResolver(extensions$1, detectCyclesAndConditional, currentlyR
|
|
4621
4643
|
parentMeta.requires = [];
|
4622
4644
|
parentMeta.isRequiredCommonJS = Object.create(null);
|
4623
4645
|
setInitialParentType(parentId, isParentCommonJS);
|
4624
|
-
const currentlyResolvingForParent = currentlyResolving.get(parentId) || new Set();
|
4646
|
+
const currentlyResolvingForParent = currentlyResolving.get(parentId) || /* @__PURE__ */ new Set();
|
4625
4647
|
currentlyResolving.set(parentId, currentlyResolvingForParent);
|
4626
4648
|
const requireTargets = await Promise.all(sources.map(async ({ source, isConditional }) => {
|
4627
4649
|
if (source.startsWith("\0")) return {
|
@@ -4635,12 +4657,12 @@ function getRequireResolver(extensions$1, detectCyclesAndConditional, currentlyR
|
|
4635
4657
|
}) || resolveExtensions(source, parentId, extensions$1);
|
4636
4658
|
currentlyResolvingForParent.delete(source);
|
4637
4659
|
if (!resolved) return {
|
4638
|
-
id: wrapId(source, EXTERNAL_SUFFIX),
|
4660
|
+
id: wrapId$1(source, EXTERNAL_SUFFIX),
|
4639
4661
|
allowProxy: false
|
4640
4662
|
};
|
4641
4663
|
const childId = resolved.id;
|
4642
4664
|
if (resolved.external) return {
|
4643
|
-
id: wrapId(childId, EXTERNAL_SUFFIX),
|
4665
|
+
id: wrapId$1(childId, EXTERNAL_SUFFIX),
|
4644
4666
|
allowProxy: false
|
4645
4667
|
};
|
4646
4668
|
parentMeta.requires.push({
|
@@ -4662,7 +4684,7 @@ function getRequireResolver(extensions$1, detectCyclesAndConditional, currentlyR
|
|
4662
4684
|
return {
|
4663
4685
|
wrappedModuleSideEffects: isWrappedCommonJS && rollupContext.getModuleInfo(dependencyId).moduleSideEffects,
|
4664
4686
|
source: sources[index].source,
|
4665
|
-
id: allowProxy ? wrapId(dependencyId, isWrappedCommonJS ? WRAPPED_SUFFIX : PROXY_SUFFIX) : dependencyId,
|
4687
|
+
id: allowProxy ? wrapId$1(dependencyId, isWrappedCommonJS ? WRAPPED_SUFFIX : PROXY_SUFFIX) : dependencyId,
|
4666
4688
|
isCommonJS
|
4667
4689
|
};
|
4668
4690
|
});
|
@@ -4890,8 +4912,8 @@ function getRequireHandlers() {
|
|
4890
4912
|
const imports = [];
|
4891
4913
|
imports.push(`import * as ${helpersName} from "${HELPERS_ID}"`);
|
4892
4914
|
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))}`);
|
4915
|
+
if (exportMode === "module") imports.push(`import { __module as ${moduleName} } from ${JSON.stringify(wrapId$1(id, MODULE_SUFFIX))}`, `var ${exportsName} = ${moduleName}.exports`);
|
4916
|
+
else if (exportMode === "exports") imports.push(`import { __exports as ${exportsName} } from ${JSON.stringify(wrapId$1(id, EXPORTS_SUFFIX))}`);
|
4895
4917
|
const requiresBySource = collectSources(requireExpressions);
|
4896
4918
|
const requireTargets = await resolveRequireSourcesAndUpdateMeta(id, needsRequireWrapper ? IS_WRAPPED_COMMONJS : !isEsModule, commonjsMeta, Object.keys(requiresBySource).map((source) => {
|
4897
4919
|
return {
|
@@ -4974,24 +4996,24 @@ async function transformCommonjs(parse$16, code, id, isEsModule, ignoreGlobal, i
|
|
4974
4996
|
let classBodyDepth = 0;
|
4975
4997
|
let currentTryBlockEnd = null;
|
4976
4998
|
let shouldWrap = false;
|
4977
|
-
const globals = new Set();
|
4999
|
+
const globals = /* @__PURE__ */ new Set();
|
4978
5000
|
let currentConditionalNodeEnd = null;
|
4979
|
-
const conditionalNodes = new Set();
|
5001
|
+
const conditionalNodes = /* @__PURE__ */ new Set();
|
4980
5002
|
const { addRequireExpression, rewriteRequireExpressionsAndGetImportBlock } = getRequireHandlers();
|
4981
|
-
const reassignedNames = new Set();
|
5003
|
+
const reassignedNames = /* @__PURE__ */ new Set();
|
4982
5004
|
const topLevelDeclarations = [];
|
4983
|
-
const skippedNodes = new Set();
|
5005
|
+
const skippedNodes = /* @__PURE__ */ new Set();
|
4984
5006
|
const moduleAccessScopes = new Set([scope]);
|
4985
5007
|
const exportsAccessScopes = new Set([scope]);
|
4986
5008
|
const moduleExportsAssignments = [];
|
4987
5009
|
let firstTopLevelModuleExportsAssignment = null;
|
4988
|
-
const exportsAssignmentsByName = new Map();
|
4989
|
-
const topLevelAssignments = new Set();
|
5010
|
+
const exportsAssignmentsByName = /* @__PURE__ */ new Map();
|
5011
|
+
const topLevelAssignments = /* @__PURE__ */ new Set();
|
4990
5012
|
const topLevelDefineCompiledEsmExpressions = [];
|
4991
5013
|
const replacedGlobal = [];
|
4992
5014
|
const replacedThis = [];
|
4993
5015
|
const replacedDynamicRequires = [];
|
4994
|
-
const importedVariables = new Set();
|
5016
|
+
const importedVariables = /* @__PURE__ */ new Set();
|
4995
5017
|
const indentExclusionRanges = [];
|
4996
5018
|
walk$2(ast, {
|
4997
5019
|
enter(node, parent) {
|
@@ -5030,7 +5052,7 @@ async function transformCommonjs(parse$16, code, id, isEsModule, ignoreGlobal, i
|
|
5030
5052
|
else {
|
5031
5053
|
const exportsAssignments = exportsAssignmentsByName.get(exportName) || {
|
5032
5054
|
nodes: [],
|
5033
|
-
scopes: new Set()
|
5055
|
+
scopes: /* @__PURE__ */ new Set()
|
5034
5056
|
};
|
5035
5057
|
exportsAssignments.nodes.push({
|
5036
5058
|
node,
|
@@ -5334,21 +5356,21 @@ function commonjs(options$1 = {}) {
|
|
5334
5356
|
async load(id) {
|
5335
5357
|
if (id === HELPERS_ID) return getHelpersModule();
|
5336
5358
|
if (isWrappedId(id, MODULE_SUFFIX)) {
|
5337
|
-
const name = getName(unwrapId(id, MODULE_SUFFIX));
|
5359
|
+
const name = getName(unwrapId$1(id, MODULE_SUFFIX));
|
5338
5360
|
return {
|
5339
5361
|
code: `var ${name} = {exports: {}}; export {${name} as __module}`,
|
5340
5362
|
meta: { commonjs: { isCommonJS: false } }
|
5341
5363
|
};
|
5342
5364
|
}
|
5343
5365
|
if (isWrappedId(id, EXPORTS_SUFFIX)) {
|
5344
|
-
const name = getName(unwrapId(id, EXPORTS_SUFFIX));
|
5366
|
+
const name = getName(unwrapId$1(id, EXPORTS_SUFFIX));
|
5345
5367
|
return {
|
5346
5368
|
code: `var ${name} = {}; export {${name} as __exports}`,
|
5347
5369
|
meta: { commonjs: { isCommonJS: false } }
|
5348
5370
|
};
|
5349
5371
|
}
|
5350
5372
|
if (isWrappedId(id, EXTERNAL_SUFFIX)) {
|
5351
|
-
const actualId = unwrapId(id, EXTERNAL_SUFFIX);
|
5373
|
+
const actualId = unwrapId$1(id, EXTERNAL_SUFFIX);
|
5352
5374
|
return getUnknownRequireProxy(actualId, isEsmExternal(actualId) ? getRequireReturnsDefault(actualId) : true);
|
5353
5375
|
}
|
5354
5376
|
if (id.endsWith(ENTRY_SUFFIX)) {
|
@@ -5358,12 +5380,12 @@ function commonjs(options$1 = {}) {
|
|
5358
5380
|
return getEntryProxy(acutalId, getDefaultIsModuleExports(acutalId), this.getModuleInfo, shebang);
|
5359
5381
|
}
|
5360
5382
|
if (isWrappedId(id, ES_IMPORT_SUFFIX)) {
|
5361
|
-
const actualId = unwrapId(id, ES_IMPORT_SUFFIX);
|
5383
|
+
const actualId = unwrapId$1(id, ES_IMPORT_SUFFIX);
|
5362
5384
|
return getEsImportProxy(actualId, getDefaultIsModuleExports(actualId), (await this.load({ id: actualId })).moduleSideEffects);
|
5363
5385
|
}
|
5364
5386
|
if (id === DYNAMIC_MODULES_ID) return getDynamicModuleRegistry(isDynamicRequireModulesEnabled, dynamicRequireModules, commonDir, ignoreDynamicRequires);
|
5365
5387
|
if (isWrappedId(id, PROXY_SUFFIX)) {
|
5366
|
-
const actualId = unwrapId(id, PROXY_SUFFIX);
|
5388
|
+
const actualId = unwrapId$1(id, PROXY_SUFFIX);
|
5367
5389
|
return getStaticRequireProxy(actualId, getRequireReturnsDefault(actualId), this.load);
|
5368
5390
|
}
|
5369
5391
|
return null;
|
@@ -5392,7 +5414,7 @@ function commonjs(options$1 = {}) {
|
|
5392
5414
|
* @experimental
|
5393
5415
|
*/
|
5394
5416
|
function perEnvironmentState(initial) {
|
5395
|
-
const stateMap = new WeakMap();
|
5417
|
+
const stateMap = /* @__PURE__ */ new WeakMap();
|
5396
5418
|
return function(context) {
|
5397
5419
|
const { environment } = context;
|
5398
5420
|
let state = stateMap.get(environment);
|
@@ -5434,7 +5456,7 @@ function getTimeFormatter() {
|
|
5434
5456
|
}
|
5435
5457
|
function createLogger(level = "info", options$1 = {}) {
|
5436
5458
|
if (options$1.customLogger) return options$1.customLogger;
|
5437
|
-
const loggedErrors = new WeakSet();
|
5459
|
+
const loggedErrors = /* @__PURE__ */ new WeakSet();
|
5438
5460
|
const { prefix: prefix$1 = "[vite]", allowClearScreen = true, console: console$1 = globalThis.console } = options$1;
|
5439
5461
|
const thresh = LogLevels[level];
|
5440
5462
|
const canClearScreen = allowClearScreen && process.stdout.isTTY && !process.env.CI;
|
@@ -5446,7 +5468,7 @@ function createLogger(level = "info", options$1 = {}) {
|
|
5446
5468
|
else if (type === "warn") tag = import_picocolors$32.default.yellow(import_picocolors$32.default.bold(prefix$1));
|
5447
5469
|
else tag = import_picocolors$32.default.red(import_picocolors$32.default.bold(prefix$1));
|
5448
5470
|
const environment = options$2.environment ? options$2.environment + " " : "";
|
5449
|
-
return `${import_picocolors$32.default.dim(getTimeFormatter().format(new Date()))} ${tag} ${environment}${msg}`;
|
5471
|
+
return `${import_picocolors$32.default.dim(getTimeFormatter().format(/* @__PURE__ */ new Date()))} ${tag} ${environment}${msg}`;
|
5450
5472
|
} else return msg;
|
5451
5473
|
}
|
5452
5474
|
function output(type, msg, options$2 = {}) {
|
@@ -5467,7 +5489,7 @@ function createLogger(level = "info", options$1 = {}) {
|
|
5467
5489
|
else console$1[method](format$3(type, msg, options$2));
|
5468
5490
|
}
|
5469
5491
|
}
|
5470
|
-
const warnedMessages = new Set();
|
5492
|
+
const warnedMessages = /* @__PURE__ */ new Set();
|
5471
5493
|
const logger = {
|
5472
5494
|
hasWarned: false,
|
5473
5495
|
info(msg, opts) {
|
@@ -5628,7 +5650,7 @@ function buildReporterPlugin(config$2) {
|
|
5628
5650
|
const sizePad = displaySize(biggestSize).length;
|
5629
5651
|
const mapPad = displaySize(biggestMap).length;
|
5630
5652
|
const compressPad = displaySize(biggestCompressSize).length;
|
5631
|
-
const relativeOutDir = normalizePath
|
5653
|
+
const relativeOutDir = normalizePath(path.relative(config$2.root, path.resolve(config$2.root, outDir ?? environment.config.build.outDir)));
|
5632
5654
|
const assetsDir = path.join(environment.config.build.assetsDir, "/");
|
5633
5655
|
for (const group of groups) {
|
5634
5656
|
const filtered = entries.filter((e$1) => e$1.group === group.name);
|
@@ -5675,7 +5697,7 @@ function buildReporterPlugin(config$2) {
|
|
5675
5697
|
const module$1 = this.getModuleInfo(id);
|
5676
5698
|
if (!module$1) continue;
|
5677
5699
|
if (module$1.importers.length && module$1.dynamicImporters.length) {
|
5678
|
-
const detectedIneffectiveDynamicImport = module$1.dynamicImporters.some((id$1) => !isInNodeModules
|
5700
|
+
const detectedIneffectiveDynamicImport = module$1.dynamicImporters.some((id$1) => !isInNodeModules(id$1) && chunk.moduleIds.includes(id$1));
|
5679
5701
|
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
5702
|
}
|
5681
5703
|
}
|
@@ -5714,7 +5736,7 @@ function throttle(fn) {
|
|
5714
5736
|
const POSIX_SEP_RE = new RegExp("\\" + path.posix.sep, "g");
|
5715
5737
|
const NATIVE_SEP_RE = new RegExp("\\" + path.sep, "g");
|
5716
5738
|
/** @type {Map<string,RegExp>}*/
|
5717
|
-
const PATTERN_REGEX_CACHE = new Map();
|
5739
|
+
const PATTERN_REGEX_CACHE = /* @__PURE__ */ new Map();
|
5718
5740
|
const GLOB_ALL_PATTERN = `**/*`;
|
5719
5741
|
const TS_EXTENSIONS = [
|
5720
5742
|
".ts",
|
@@ -5767,7 +5789,7 @@ async function resolveTSConfigJson(filename, cache$1) {
|
|
5767
5789
|
* @param {string} dir an absolute directory path
|
5768
5790
|
* @returns {boolean} if dir path includes a node_modules segment
|
5769
5791
|
*/
|
5770
|
-
const isInNodeModules = IS_POSIX ? (dir) => dir.includes("/node_modules/") : (dir) => dir.match(/[/\\]node_modules[/\\]/);
|
5792
|
+
const isInNodeModules$1 = IS_POSIX ? (dir) => dir.includes("/node_modules/") : (dir) => dir.match(/[/\\]node_modules[/\\]/);
|
5771
5793
|
/**
|
5772
5794
|
* convert posix separator to native separator
|
5773
5795
|
*
|
@@ -5952,7 +5974,7 @@ function replaceTokens(result) {
|
|
5952
5974
|
*/
|
5953
5975
|
async function find(filename, options$1) {
|
5954
5976
|
let dir = path.dirname(path.resolve(filename));
|
5955
|
-
if (options$1?.ignoreNodeModules && isInNodeModules(dir)) return null;
|
5977
|
+
if (options$1?.ignoreNodeModules && isInNodeModules$1(dir)) return null;
|
5956
5978
|
const cache$1 = options$1?.cache;
|
5957
5979
|
const configName = options$1?.configName ?? "tsconfig.json";
|
5958
5980
|
if (cache$1?.hasConfigPath(dir, configName)) return cache$1.getConfigPath(dir, configName);
|
@@ -6539,14 +6561,14 @@ var TSConfckCache = class {
|
|
6539
6561
|
* @private
|
6540
6562
|
* @type{Map<string,(Promise<string|null>|string|null)>}
|
6541
6563
|
*/
|
6542
|
-
#configPaths = new Map();
|
6564
|
+
#configPaths = /* @__PURE__ */ new Map();
|
6543
6565
|
/**
|
6544
6566
|
* map files to their parsed tsconfig result
|
6545
6567
|
* @internal
|
6546
6568
|
* @private
|
6547
6569
|
* @type {Map<string,(Promise<T>|T)> }
|
6548
6570
|
*/
|
6549
|
-
#parsed = new Map();
|
6571
|
+
#parsed = /* @__PURE__ */ new Map();
|
6550
6572
|
};
|
6551
6573
|
|
6552
6574
|
//#endregion
|
@@ -6649,7 +6671,7 @@ async function transformWithEsbuild(code, filename, options$1, inMap, config$2,
|
|
6649
6671
|
function esbuildPlugin(config$2) {
|
6650
6672
|
const options$1 = config$2.esbuild;
|
6651
6673
|
const { jsxInject, include, exclude,...esbuildTransformOptions } = options$1;
|
6652
|
-
const filter$1 = createFilter
|
6674
|
+
const filter$1 = createFilter(include || /\.(m?ts|[jt]sx)$/, exclude || /\.js$/);
|
6653
6675
|
const transformOptions = {
|
6654
6676
|
target: "esnext",
|
6655
6677
|
charset: "utf8",
|
@@ -6776,7 +6798,7 @@ function prettifyMessage(m$2, code) {
|
|
6776
6798
|
return res + `\n`;
|
6777
6799
|
}
|
6778
6800
|
let globalTSConfckCache;
|
6779
|
-
const tsconfckCacheMap = new WeakMap();
|
6801
|
+
const tsconfckCacheMap = /* @__PURE__ */ new WeakMap();
|
6780
6802
|
function getTSConfckCache(config$2) {
|
6781
6803
|
if (!config$2) return globalTSConfckCache ??= new TSConfckCache();
|
6782
6804
|
let cache$1 = tsconfckCacheMap.get(config$2);
|
@@ -7641,7 +7663,7 @@ function lookup(extn) {
|
|
7641
7663
|
|
7642
7664
|
//#endregion
|
7643
7665
|
//#region src/node/publicDir.ts
|
7644
|
-
const publicFilesMap = new WeakMap();
|
7666
|
+
const publicFilesMap = /* @__PURE__ */ new WeakMap();
|
7645
7667
|
async function initPublicFiles(config$2) {
|
7646
7668
|
let fileNames;
|
7647
7669
|
try {
|
@@ -7662,8 +7684,8 @@ function checkPublicFile(url$6, config$2) {
|
|
7662
7684
|
if (!publicDir || url$6[0] !== "/") return;
|
7663
7685
|
const fileName = cleanUrl(url$6);
|
7664
7686
|
const publicFiles = getPublicFiles(config$2);
|
7665
|
-
if (publicFiles) return publicFiles.has(fileName) ? normalizePath
|
7666
|
-
const publicFile = normalizePath
|
7687
|
+
if (publicFiles) return publicFiles.has(fileName) ? normalizePath(path.join(publicDir, fileName)) : void 0;
|
7688
|
+
const publicFile = normalizePath(path.join(publicDir, fileName));
|
7667
7689
|
if (!publicFile.startsWith(withTrailingSlash(publicDir))) return;
|
7668
7690
|
return fs.existsSync(publicFile) ? publicFile : void 0;
|
7669
7691
|
}
|
@@ -7676,9 +7698,9 @@ const jsSourceMapRE = /\.[cm]?js\.map$/;
|
|
7676
7698
|
const noInlineRE = /[?&]no-inline\b/;
|
7677
7699
|
const inlineRE$3 = /[?&]inline\b/;
|
7678
7700
|
const svgExtRE = /\.svg(?:$|\?)/;
|
7679
|
-
const assetCache = new WeakMap();
|
7701
|
+
const assetCache = /* @__PURE__ */ new WeakMap();
|
7680
7702
|
/** a set of referenceId for entry CSS assets for each environment */
|
7681
|
-
const cssEntriesMap = new WeakMap();
|
7703
|
+
const cssEntriesMap = /* @__PURE__ */ new WeakMap();
|
7682
7704
|
function registerCustomMime() {
|
7683
7705
|
mimes.ico = "image/x-icon";
|
7684
7706
|
mimes.cur = "image/x-icon";
|
@@ -7722,22 +7744,22 @@ function assetPlugin(config$2) {
|
|
7722
7744
|
name: "vite:asset",
|
7723
7745
|
perEnvironmentStartEndDuringDev: true,
|
7724
7746
|
buildStart() {
|
7725
|
-
assetCache.set(this.environment, new Map());
|
7726
|
-
cssEntriesMap.set(this.environment, new Set());
|
7747
|
+
assetCache.set(this.environment, /* @__PURE__ */ new Map());
|
7748
|
+
cssEntriesMap.set(this.environment, /* @__PURE__ */ new Set());
|
7727
7749
|
},
|
7728
7750
|
resolveId: { handler(id) {
|
7729
|
-
if (!config$2.assetsInclude(cleanUrl(id)) && !urlRE
|
7751
|
+
if (!config$2.assetsInclude(cleanUrl(id)) && !urlRE.test(id)) return;
|
7730
7752
|
const publicFile = checkPublicFile(id, config$2);
|
7731
7753
|
if (publicFile) return id;
|
7732
7754
|
} },
|
7733
7755
|
load: { async handler(id) {
|
7734
7756
|
if (id[0] === "\0") return;
|
7735
|
-
if (rawRE
|
7757
|
+
if (rawRE.test(id)) {
|
7736
7758
|
const file = checkPublicFile(id, config$2) || cleanUrl(id);
|
7737
7759
|
this.addWatchFile(file);
|
7738
7760
|
return `export default ${JSON.stringify(await fsp.readFile(file, "utf-8"))}`;
|
7739
7761
|
}
|
7740
|
-
if (!urlRE
|
7762
|
+
if (!urlRE.test(id) && !config$2.assetsInclude(cleanUrl(id))) return;
|
7741
7763
|
id = removeUrlQuery(id);
|
7742
7764
|
let url$6 = await fileToUrl$1(this, id);
|
7743
7765
|
if (!url$6.startsWith("data:") && this.environment.mode === "dev") {
|
@@ -7764,7 +7786,7 @@ function assetPlugin(config$2) {
|
|
7764
7786
|
const chunk = bundle[file];
|
7765
7787
|
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
7788
|
if (!importedFiles) {
|
7767
|
-
importedFiles = new Set();
|
7789
|
+
importedFiles = /* @__PURE__ */ new Set();
|
7768
7790
|
for (const file$1 in bundle) {
|
7769
7791
|
const chunk$1 = bundle[file$1];
|
7770
7792
|
if (chunk$1.type === "chunk") {
|
@@ -7812,14 +7834,14 @@ async function fileToDevUrl(environment, id, skipBase = false) {
|
|
7812
7834
|
function getPublicAssetFilename(hash$1, config$2) {
|
7813
7835
|
return publicAssetUrlCache.get(config$2)?.get(hash$1);
|
7814
7836
|
}
|
7815
|
-
const publicAssetUrlCache = new WeakMap();
|
7837
|
+
const publicAssetUrlCache = /* @__PURE__ */ new WeakMap();
|
7816
7838
|
const publicAssetUrlRE = /__VITE_PUBLIC_ASSET__([a-z\d]{8})__/g;
|
7817
7839
|
function publicFileToBuiltUrl(url$6, config$2) {
|
7818
7840
|
if (config$2.command !== "build") return joinUrlSegments(config$2.decodedBase, url$6);
|
7819
7841
|
const hash$1 = getHash(url$6);
|
7820
7842
|
let cache$1 = publicAssetUrlCache.get(config$2);
|
7821
7843
|
if (!cache$1) {
|
7822
|
-
cache$1 = new Map();
|
7844
|
+
cache$1 = /* @__PURE__ */ new Map();
|
7823
7845
|
publicAssetUrlCache.set(config$2, cache$1);
|
7824
7846
|
}
|
7825
7847
|
if (!cache$1.get(hash$1)) cache$1.set(hash$1, url$6);
|
@@ -7850,7 +7872,7 @@ async function fileToBuiltUrl(pluginContext, id, skipPublicCheck = false, forceI
|
|
7850
7872
|
let url$6;
|
7851
7873
|
if (shouldInline(environment, file, id, content, pluginContext, forceInline)) url$6 = assetToDataURL(environment, file, content);
|
7852
7874
|
else {
|
7853
|
-
const originalFileName = normalizePath
|
7875
|
+
const originalFileName = normalizePath(path.relative(environment.config.root, file));
|
7854
7876
|
const referenceId = pluginContext.emitFile({
|
7855
7877
|
type: "asset",
|
7856
7878
|
name: path.basename(file),
|
@@ -8007,7 +8029,7 @@ function manifestPlugin() {
|
|
8007
8029
|
}
|
8008
8030
|
function getChunkOriginalFileName(chunk, root, format$3) {
|
8009
8031
|
if (chunk.facadeModuleId) {
|
8010
|
-
let name = normalizePath
|
8032
|
+
let name = normalizePath(path.relative(root, chunk.facadeModuleId));
|
8011
8033
|
if (format$3 === "system" && !chunk.name.includes("-legacy")) {
|
8012
8034
|
const ext = path.extname(name);
|
8013
8035
|
const endPos = ext.length !== 0 ? -ext.length : void 0;
|
@@ -8030,7 +8052,7 @@ function dataURIPlugin() {
|
|
8030
8052
|
return {
|
8031
8053
|
name: "vite:data-uri",
|
8032
8054
|
buildStart() {
|
8033
|
-
resolved = new Map();
|
8055
|
+
resolved = /* @__PURE__ */ new Map();
|
8034
8056
|
},
|
8035
8057
|
resolveId(id) {
|
8036
8058
|
if (!id.trimStart().startsWith("data:")) return;
|
@@ -8058,8 +8080,8 @@ var ImportType;
|
|
8058
8080
|
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
8081
|
})(ImportType || (ImportType = {}));
|
8060
8082
|
const A = 1 === new Uint8Array(new Uint16Array([1]).buffer)[0];
|
8061
|
-
function parse
|
8062
|
-
if (!C) return init
|
8083
|
+
function parse(E$1, g = "@") {
|
8084
|
+
if (!C) return init.then(() => parse(E$1));
|
8063
8085
|
const I = E$1.length + 1, w$1 = (C.__heap_base.value || C.__heap_base) + 4 * I - C.memory.buffer.byteLength;
|
8064
8086
|
w$1 > 0 && C.memory.grow(Math.ceil(w$1 / 65536));
|
8065
8087
|
const K = C.sa(I - 1);
|
@@ -8120,7 +8142,7 @@ const E = () => {
|
|
8120
8142
|
return A$1 = "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GzYCHAtBAEEAKAKwCkECajYCsAoCQAJAAkACQEEAECkiAUHhAEYNACABQfcARg0BQQAoArAKIQEMAgtBACgCsAoiAUECakHACEEKEC8NAUEGIQIMAgtBACgCsAoiAS8BAkHpAEcNACABLwEEQfQARw0AQQQhAiABLwEGQegARg0BC0EAIAFBfmo2ArAKDwtBACABIAJBAXRqNgKwCgJAQQEQKUH7AEYNAEEAIAE2ArAKDwtBACgCsAoiACECA0BBACACQQJqNgKwCgJAAkACQEEBECkiAkEiRg0AIAJBJ0cNAUEnEBpBAEEAKAKwCkECajYCsApBARApIQIMAgtBIhAaQQBBACgCsApBAmo2ArAKQQEQKSECDAELIAIQLCECCwJAIAJBOkYNAEEAIAE2ArAKDwtBAEEAKAKwCkECajYCsAoCQEEBECkiAkEiRg0AIAJBJ0YNAEEAIAE2ArAKDwsgAhAaQQBBACgCsApBAmo2ArAKAkACQEEBECkiAkEsRg0AIAJB/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
8143
|
var A$1;
|
8122
8144
|
};
|
8123
|
-
const init
|
8145
|
+
const init = WebAssembly.compile(E()).then(WebAssembly.instantiate).then(({ exports: A$1 }) => {
|
8124
8146
|
C = A$1;
|
8125
8147
|
});
|
8126
8148
|
|
@@ -8335,9 +8357,9 @@ function applySourcemapIgnoreList(map$1, sourcemapPath, sourcemapIgnoreList, log
|
|
8335
8357
|
}
|
8336
8358
|
}
|
8337
8359
|
async function extractSourcemapFromFile(code, filePath) {
|
8338
|
-
const map$1 = (import_convert_source_map$2.
|
8360
|
+
const map$1 = (import_convert_source_map$2.fromSource(code) || await import_convert_source_map$2.fromMapFileSource(code, createConvertSourceMapReadMap(filePath)))?.toObject();
|
8339
8361
|
if (map$1) return {
|
8340
|
-
code: code.replace(import_convert_source_map$2.
|
8362
|
+
code: code.replace(import_convert_source_map$2.mapFileCommentRegex, blankReplacer),
|
8341
8363
|
map: map$1
|
8342
8364
|
};
|
8343
8365
|
}
|
@@ -8473,8 +8495,8 @@ var require_src$1 = __commonJS({ "../../node_modules/.pnpm/lilconfig@3.1.3/node_
|
|
8473
8495
|
/** @type {import('./index').lilconfig} */
|
8474
8496
|
module.exports.lilconfig = function lilconfig(name, options$1) {
|
8475
8497
|
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();
|
8498
|
+
const searchCache = /* @__PURE__ */ new Map();
|
8499
|
+
const loadCache = /* @__PURE__ */ new Map();
|
8478
8500
|
const emplace = makeEmplace(cache$1);
|
8479
8501
|
return {
|
8480
8502
|
async search(searchFrom = process.cwd()) {
|
@@ -8484,7 +8506,7 @@ var require_src$1 = __commonJS({ "../../node_modules/.pnpm/lilconfig@3.1.3/node_
|
|
8484
8506
|
filepath: ""
|
8485
8507
|
};
|
8486
8508
|
/** @type {Set<string>} */
|
8487
|
-
const visited = new Set();
|
8509
|
+
const visited = /* @__PURE__ */ new Set();
|
8488
8510
|
let dir = searchFrom;
|
8489
8511
|
dirLoop: while (true) {
|
8490
8512
|
if (cache$1) {
|
@@ -8585,8 +8607,8 @@ var require_src$1 = __commonJS({ "../../node_modules/.pnpm/lilconfig@3.1.3/node_
|
|
8585
8607
|
/** @type {import('./index').lilconfigSync} */
|
8586
8608
|
module.exports.lilconfigSync = function lilconfigSync(name, options$1) {
|
8587
8609
|
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();
|
8610
|
+
const searchCache = /* @__PURE__ */ new Map();
|
8611
|
+
const loadCache = /* @__PURE__ */ new Map();
|
8590
8612
|
const emplace = makeEmplace(cache$1);
|
8591
8613
|
return {
|
8592
8614
|
search(searchFrom = process.cwd()) {
|
@@ -8596,7 +8618,7 @@ var require_src$1 = __commonJS({ "../../node_modules/.pnpm/lilconfig@3.1.3/node_
|
|
8596
8618
|
filepath: ""
|
8597
8619
|
};
|
8598
8620
|
/** @type {Set<string>} */
|
8599
|
-
const visited = new Set();
|
8621
|
+
const visited = /* @__PURE__ */ new Set();
|
8600
8622
|
let dir = searchFrom;
|
8601
8623
|
dirLoop: while (true) {
|
8602
8624
|
if (cache$1) {
|
@@ -8696,8 +8718,8 @@ var require_src$1 = __commonJS({ "../../node_modules/.pnpm/lilconfig@3.1.3/node_
|
|
8696
8718
|
} });
|
8697
8719
|
|
8698
8720
|
//#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.
|
8721
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.5_tsx@4.20.3_yaml@2.8.0/node_modules/postcss-load-config/src/req.js
|
8722
|
+
var require_req = __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.5_tsx@4.20.3_yaml@2.8.0/node_modules/postcss-load-config/src/req.js"(exports, module) {
|
8701
8723
|
const { createRequire: createRequire$2 } = require("node:module");
|
8702
8724
|
const { fileURLToPath: fileURLToPath$1, pathToFileURL: pathToFileURL$1 } = require("node:url");
|
8703
8725
|
const TS_EXT_RE = /\.[mc]?ts$/;
|
@@ -8739,8 +8761,8 @@ var require_req = __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0
|
|
8739
8761
|
} });
|
8740
8762
|
|
8741
8763
|
//#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.
|
8764
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.5_tsx@4.20.3_yaml@2.8.0/node_modules/postcss-load-config/src/options.js
|
8765
|
+
var require_options = __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.5_tsx@4.20.3_yaml@2.8.0/node_modules/postcss-load-config/src/options.js"(exports, module) {
|
8744
8766
|
const req$2 = require_req();
|
8745
8767
|
/**
|
8746
8768
|
* Load Options
|
@@ -8774,8 +8796,8 @@ var require_options = __commonJS({ "../../node_modules/.pnpm/postcss-load-config
|
|
8774
8796
|
} });
|
8775
8797
|
|
8776
8798
|
//#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.
|
8799
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.5_tsx@4.20.3_yaml@2.8.0/node_modules/postcss-load-config/src/plugins.js
|
8800
|
+
var require_plugins = __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.5_tsx@4.20.3_yaml@2.8.0/node_modules/postcss-load-config/src/plugins.js"(exports, module) {
|
8779
8801
|
const req$1 = require_req();
|
8780
8802
|
/**
|
8781
8803
|
* Plugin Loader
|
@@ -8829,8 +8851,8 @@ var require_plugins = __commonJS({ "../../node_modules/.pnpm/postcss-load-config
|
|
8829
8851
|
} });
|
8830
8852
|
|
8831
8853
|
//#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.
|
8854
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.5_tsx@4.20.3_yaml@2.8.0/node_modules/postcss-load-config/src/index.js
|
8855
|
+
var require_src = __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.4.2_postcss@8.5.5_tsx@4.20.3_yaml@2.8.0/node_modules/postcss-load-config/src/index.js"(exports, module) {
|
8834
8856
|
const { resolve: resolve$2 } = require("node:path");
|
8835
8857
|
const config$1 = require_src$1();
|
8836
8858
|
const loadOptions = require_options();
|
@@ -9008,7 +9030,7 @@ function resolveCustomResolver(customResolver) {
|
|
9008
9030
|
if (customResolver) return getHookFunction(customResolver.resolveId);
|
9009
9031
|
return null;
|
9010
9032
|
}
|
9011
|
-
function alias
|
9033
|
+
function alias(options$1 = {}) {
|
9012
9034
|
const entries = getEntries(options$1);
|
9013
9035
|
if (entries.length === 0) return {
|
9014
9036
|
name: "alias",
|
@@ -9133,7 +9155,7 @@ function t(e$1, n$2, r$2) {
|
|
9133
9155
|
if ("string" == typeof e$1) return r$2 && r$2.add(e$1), [e$1];
|
9134
9156
|
let i$1, o$1;
|
9135
9157
|
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);
|
9158
|
+
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
9159
|
if (!r$2 && o$1.size) return [...o$1];
|
9138
9160
|
} else for (i$1 in e$1) if (n$2.has(i$1)) return t(e$1[i$1], n$2, r$2);
|
9139
9161
|
}
|
@@ -9239,7 +9261,7 @@ function formatList(array, type = "and") {
|
|
9239
9261
|
return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array[array.length - 1]}`;
|
9240
9262
|
}
|
9241
9263
|
/** @type {Map<string, MessageFunction | string>} */
|
9242
|
-
const messages = new Map();
|
9264
|
+
const messages = /* @__PURE__ */ new Map();
|
9243
9265
|
const nodeInternalPrefix = "__node_internal_";
|
9244
9266
|
/** @type {number} */
|
9245
9267
|
let userStackTraceLimit;
|
@@ -9595,8 +9617,8 @@ function esbuildDepPlugin(environment, qualified, external) {
|
|
9595
9617
|
const { isProduction } = environment.config;
|
9596
9618
|
const { extensions: extensions$1 } = environment.config.optimizeDeps;
|
9597
9619
|
const allExternalTypes = extensions$1 ? externalTypes.filter((type) => !extensions$1.includes("." + type)) : externalTypes;
|
9598
|
-
const esmPackageCache = new Map();
|
9599
|
-
const cjsPackageCache = new Map();
|
9620
|
+
const esmPackageCache = /* @__PURE__ */ new Map();
|
9621
|
+
const cjsPackageCache = /* @__PURE__ */ new Map();
|
9600
9622
|
const _resolve = createBackCompatIdResolver(environment.getTopLevelConfig(), {
|
9601
9623
|
asSrc: false,
|
9602
9624
|
scan: true,
|
@@ -9610,7 +9632,7 @@ function esbuildDepPlugin(environment, qualified, external) {
|
|
9610
9632
|
});
|
9611
9633
|
const resolve$5 = (id, importer, kind, resolveDir) => {
|
9612
9634
|
let _importer;
|
9613
|
-
if (resolveDir) _importer = normalizePath
|
9635
|
+
if (resolveDir) _importer = normalizePath(path.join(resolveDir, "*"));
|
9614
9636
|
else _importer = importer in qualified ? qualified[importer] : importer;
|
9615
9637
|
const resolver = kind.startsWith("require") ? _resolveRequire : _resolve;
|
9616
9638
|
return resolver(environment, id, _importer);
|
@@ -10300,7 +10322,7 @@ function stripLiteralDetailed(code, options$1) {
|
|
10300
10322
|
//#region src/node/plugins/importMetaGlob.ts
|
10301
10323
|
var import_picocolors$27 = __toESM(require_picocolors(), 1);
|
10302
10324
|
function importGlobPlugin(config$2) {
|
10303
|
-
const importGlobMaps = new Map();
|
10325
|
+
const importGlobMaps = /* @__PURE__ */ new Map();
|
10304
10326
|
return {
|
10305
10327
|
name: "vite:import-glob",
|
10306
10328
|
buildStart() {
|
@@ -10311,7 +10333,7 @@ function importGlobPlugin(config$2) {
|
|
10311
10333
|
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
10334
|
if (result) {
|
10313
10335
|
const allGlobs = result.matches.map((i$1) => i$1.globsResolved);
|
10314
|
-
if (!importGlobMaps.has(this.environment)) importGlobMaps.set(this.environment, new Map());
|
10336
|
+
if (!importGlobMaps.has(this.environment)) importGlobMaps.set(this.environment, /* @__PURE__ */ new Map());
|
10315
10337
|
const globMatchers = allGlobs.map((globs) => {
|
10316
10338
|
const affirmed = [];
|
10317
10339
|
const negated = [];
|
@@ -10347,7 +10369,8 @@ const knownOptions = {
|
|
10347
10369
|
eager: ["boolean"],
|
10348
10370
|
import: ["string"],
|
10349
10371
|
exhaustive: ["boolean"],
|
10350
|
-
query: ["object", "string"]
|
10372
|
+
query: ["object", "string"],
|
10373
|
+
base: ["string"]
|
10351
10374
|
};
|
10352
10375
|
const forceDefaultAs = ["raw", "url"];
|
10353
10376
|
function err$1(e$1, pos) {
|
@@ -10369,6 +10392,10 @@ function parseGlobOptions(rawOpts, optsStartIndex, logger) {
|
|
10369
10392
|
const valueType = typeof opts[key];
|
10370
10393
|
if (!allowedTypes.includes(valueType)) throw err$1(`Expected glob option "${key}" to be of type ${allowedTypes.join(" or ")}, but got ${valueType}`, optsStartIndex);
|
10371
10394
|
}
|
10395
|
+
if (opts.base) {
|
10396
|
+
if (opts.base[0] === "!") throw err$1("Option \"base\" cannot start with \"!\"", optsStartIndex);
|
10397
|
+
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);
|
10398
|
+
}
|
10372
10399
|
if (typeof opts.query === "object") {
|
10373
10400
|
for (const key in opts.query) {
|
10374
10401
|
const value$1 = opts.query[key];
|
@@ -10436,7 +10463,7 @@ async function parseImportGlob(code, importer, root, resolveId, logger) {
|
|
10436
10463
|
if (arg2.type !== "ObjectExpression") throw err$2(`Expected the second argument to be an object literal, but got "${arg2.type}"`);
|
10437
10464
|
options$1 = parseGlobOptions(code.slice(start + arg2.start, start + arg2.end), start + arg2.start, logger);
|
10438
10465
|
}
|
10439
|
-
const globsResolved = await Promise.all(globs.map((glob$1) => toAbsoluteGlob(glob$1, root, importer, resolveId)));
|
10466
|
+
const globsResolved = await Promise.all(globs.map((glob$1) => toAbsoluteGlob(glob$1, root, importer, resolveId, options$1.base)));
|
10440
10467
|
const isRelative$1 = globs.every((i$1) => ".!".includes(i$1[0]));
|
10441
10468
|
const sliceCode = cleanCode.slice(0, start);
|
10442
10469
|
const onlyKeys = objectKeysRE.test(sliceCode);
|
@@ -10480,12 +10507,12 @@ const { basename: basename$2, dirname: dirname$2, relative: relative$2 } = posix
|
|
10480
10507
|
* @param optimizeExport for dynamicImportVar plugin don't need to optimize export.
|
10481
10508
|
*/
|
10482
10509
|
async function transformGlobImport(code, id, root, resolveId, restoreQueryExtension = false, logger) {
|
10483
|
-
id = slash
|
10484
|
-
root = slash
|
10510
|
+
id = slash(id);
|
10511
|
+
root = slash(root);
|
10485
10512
|
const isVirtual = isVirtualModule(id);
|
10486
10513
|
const dir = isVirtual ? void 0 : dirname$2(id);
|
10487
10514
|
const matches$2 = await parseImportGlob(code, isVirtual ? void 0 : id, root, resolveId, logger);
|
10488
|
-
const matchedFiles = new Set();
|
10515
|
+
const matchedFiles = /* @__PURE__ */ new Set();
|
10489
10516
|
if (!matches$2.length) return null;
|
10490
10517
|
const s$2 = new MagicString(code);
|
10491
10518
|
const staticImports = (await Promise.all(matches$2.map(async ({ globsResolved, isRelative: isRelative$1, options: options$1, index, start, end, onlyKeys, onlyValues }) => {
|
@@ -10501,17 +10528,24 @@ async function transformGlobImport(code, id, root, resolveId, restoreQueryExtens
|
|
10501
10528
|
const staticImports$1 = [];
|
10502
10529
|
const resolvePaths = (file) => {
|
10503
10530
|
if (!dir) {
|
10504
|
-
if (isRelative$1) throw new Error("In virtual modules, all globs must start with '/'");
|
10505
|
-
const
|
10531
|
+
if (!options$1.base && isRelative$1) throw new Error("In virtual modules, all globs must start with '/'");
|
10532
|
+
const importPath$1 = `/${relative$2(root, file)}`;
|
10533
|
+
let filePath$1 = options$1.base ? `${relative$2(posix.join(root, options$1.base), file)}` : importPath$1;
|
10534
|
+
if (options$1.base && filePath$1[0] !== ".") filePath$1 = `./${filePath$1}`;
|
10506
10535
|
return {
|
10507
10536
|
filePath: filePath$1,
|
10508
|
-
importPath:
|
10537
|
+
importPath: importPath$1
|
10509
10538
|
};
|
10510
10539
|
}
|
10511
10540
|
let importPath = relative$2(dir, file);
|
10512
10541
|
if (importPath[0] !== ".") importPath = `./${importPath}`;
|
10513
10542
|
let filePath;
|
10514
|
-
if (
|
10543
|
+
if (options$1.base) {
|
10544
|
+
const resolvedBasePath = options$1.base[0] === "/" ? root : dir;
|
10545
|
+
filePath = relative$2(posix.join(resolvedBasePath, options$1.base), file);
|
10546
|
+
if (filePath[0] !== ".") filePath = `./${filePath}`;
|
10547
|
+
if (options$1.base[0] === "/") importPath = `/${relative$2(root, file)}`;
|
10548
|
+
} else if (isRelative$1) filePath = importPath;
|
10515
10549
|
else {
|
10516
10550
|
filePath = relative$2(root, file);
|
10517
10551
|
if (filePath[0] !== ".") filePath = `/${filePath}`;
|
@@ -10565,7 +10599,7 @@ async function transformGlobImport(code, id, root, resolveId, restoreQueryExtens
|
|
10565
10599
|
};
|
10566
10600
|
}
|
10567
10601
|
function globSafePath(path$13) {
|
10568
|
-
return escapePath(normalizePath
|
10602
|
+
return escapePath(normalizePath(path$13));
|
10569
10603
|
}
|
10570
10604
|
function lastNthChar(str, n$2) {
|
10571
10605
|
return str.charAt(str.length - 1 - n$2);
|
@@ -10579,20 +10613,23 @@ function globSafeResolvedPath(resolved, glob$1) {
|
|
10579
10613
|
const dynamicPart = resolved.slice(staticPartEnd);
|
10580
10614
|
return globSafePath(staticPart) + dynamicPart;
|
10581
10615
|
}
|
10582
|
-
async function toAbsoluteGlob(glob$1, root, importer, resolveId) {
|
10616
|
+
async function toAbsoluteGlob(glob$1, root, importer, resolveId, base) {
|
10583
10617
|
let pre = "";
|
10584
10618
|
if (glob$1[0] === "!") {
|
10585
10619
|
pre = "!";
|
10586
10620
|
glob$1 = glob$1.slice(1);
|
10587
10621
|
}
|
10588
10622
|
root = globSafePath(root);
|
10589
|
-
|
10623
|
+
let dir;
|
10624
|
+
if (base) if (base.startsWith("/")) dir = posix.join(root, base);
|
10625
|
+
else dir = posix.resolve(importer ? globSafePath(dirname$2(importer)) : root, base);
|
10626
|
+
else dir = importer ? globSafePath(dirname$2(importer)) : root;
|
10590
10627
|
if (glob$1[0] === "/") return pre + posix.join(root, glob$1.slice(1));
|
10591
10628
|
if (glob$1.startsWith("./")) return pre + posix.join(dir, glob$1.slice(2));
|
10592
10629
|
if (glob$1.startsWith("../")) return pre + posix.join(dir, glob$1);
|
10593
10630
|
if (glob$1.startsWith("**")) return pre + glob$1;
|
10594
10631
|
const isSubImportsPattern = glob$1[0] === "#" && glob$1.includes("*");
|
10595
|
-
const resolved = normalizePath
|
10632
|
+
const resolved = normalizePath(await resolveId(glob$1, importer, { custom: { "vite:import-glob": { isSubImportsPattern } } }) || glob$1);
|
10596
10633
|
if (isAbsolute(resolved)) return pre + globSafeResolvedPath(resolved, glob$1);
|
10597
10634
|
throw new Error(`Invalid glob: "${glob$1}" (resolved: "${resolved}"). It must start with '/' or './'`);
|
10598
10635
|
}
|
@@ -10736,13 +10773,13 @@ async function computeEntries(environment) {
|
|
10736
10773
|
if (explicitEntryPatterns) entries = await globEntries(explicitEntryPatterns, environment);
|
10737
10774
|
else if (buildInput) {
|
10738
10775
|
const resolvePath = async (p$1) => {
|
10739
|
-
const id = (await environment.pluginContainer.resolveId(p$1,
|
10776
|
+
const id = (await environment.pluginContainer.resolveId(p$1, path.join(process.cwd(), "*"), { scan: true }))?.id;
|
10740
10777
|
if (id === void 0) throw new Error(`failed to resolve rollupOptions.input value: ${JSON.stringify(p$1)}.`);
|
10741
10778
|
return id;
|
10742
10779
|
};
|
10743
10780
|
if (typeof buildInput === "string") entries = [await resolvePath(buildInput)];
|
10744
10781
|
else if (Array.isArray(buildInput)) entries = await Promise.all(buildInput.map(resolvePath));
|
10745
|
-
else if (isObject
|
10782
|
+
else if (isObject(buildInput)) entries = await Promise.all(Object.values(buildInput).map(resolvePath));
|
10746
10783
|
else throw new Error("invalid rollupOptions.input value.");
|
10747
10784
|
} else entries = await globEntries("**/*.html", environment);
|
10748
10785
|
entries = entries.filter((entry) => isScannable(entry, environment.config.optimizeDeps.extensions) && fs.existsSync(entry));
|
@@ -10800,9 +10837,9 @@ const langRE = /\blang\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s'">]+))/i;
|
|
10800
10837
|
const svelteScriptModuleRE = /\bcontext\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s'">]+))/i;
|
10801
10838
|
const svelteModuleRE = /\smodule\b/i;
|
10802
10839
|
function esbuildScanPlugin(environment, depImports, missing, entries) {
|
10803
|
-
const seen$1 = new Map();
|
10840
|
+
const seen$1 = /* @__PURE__ */ new Map();
|
10804
10841
|
async function resolveId(id, importer) {
|
10805
|
-
return environment.pluginContainer.resolveId(id, importer && normalizePath
|
10842
|
+
return environment.pluginContainer.resolveId(id, importer && normalizePath(importer), { scan: true });
|
10806
10843
|
}
|
10807
10844
|
const resolve$5 = async (id, importer) => {
|
10808
10845
|
const key = id + (importer && path.dirname(importer));
|
@@ -10858,7 +10895,7 @@ function esbuildScanPlugin(environment, depImports, missing, entries) {
|
|
10858
10895
|
build$3.onResolve({ filter: htmlTypesRE }, async ({ path: path$13, importer }) => {
|
10859
10896
|
const resolved = await resolve$5(path$13, importer);
|
10860
10897
|
if (!resolved) return;
|
10861
|
-
if (isInNodeModules
|
10898
|
+
if (isInNodeModules(resolved) && isOptimizable(resolved, optimizeDepsOptions)) return;
|
10862
10899
|
return {
|
10863
10900
|
path: resolved,
|
10864
10901
|
namespace: "html"
|
@@ -10891,13 +10928,13 @@ function esbuildScanPlugin(environment, depImports, missing, entries) {
|
|
10891
10928
|
if (contents.includes("import.meta.glob")) scripts[key] = {
|
10892
10929
|
loader: "js",
|
10893
10930
|
contents: await doTransformGlobImport(contents, p$1, loader$1),
|
10894
|
-
resolveDir: normalizePath
|
10931
|
+
resolveDir: normalizePath(path.dirname(p$1)),
|
10895
10932
|
pluginData: { htmlType: { loader: loader$1 } }
|
10896
10933
|
};
|
10897
10934
|
else scripts[key] = {
|
10898
10935
|
loader: loader$1,
|
10899
10936
|
contents,
|
10900
|
-
resolveDir: normalizePath
|
10937
|
+
resolveDir: normalizePath(path.dirname(p$1)),
|
10901
10938
|
pluginData: { htmlType: { loader: loader$1 } }
|
10902
10939
|
};
|
10903
10940
|
const virtualModulePath = JSON.stringify(virtualModulePrefix + key);
|
@@ -10937,7 +10974,7 @@ function esbuildScanPlugin(environment, depImports, missing, entries) {
|
|
10937
10974
|
const resolved = await resolve$5(id, importer);
|
10938
10975
|
if (resolved) {
|
10939
10976
|
if (shouldExternalizeDep(resolved, id)) return externalUnlessEntry({ path: id });
|
10940
|
-
if (isInNodeModules
|
10977
|
+
if (isInNodeModules(resolved) || include?.includes(id)) {
|
10941
10978
|
if (isOptimizable(resolved, optimizeDepsOptions)) depImports[id] = resolved;
|
10942
10979
|
return externalUnlessEntry({ path: id });
|
10943
10980
|
} else if (isScannable(resolved, optimizeDepsOptions.extensions)) {
|
@@ -10947,7 +10984,7 @@ function esbuildScanPlugin(environment, depImports, missing, entries) {
|
|
10947
10984
|
namespace
|
10948
10985
|
};
|
10949
10986
|
} else return externalUnlessEntry({ path: id });
|
10950
|
-
} else missing[id] = normalizePath
|
10987
|
+
} else missing[id] = normalizePath(importer);
|
10951
10988
|
});
|
10952
10989
|
const setupExternalize = (filter$1, doExternalize) => {
|
10953
10990
|
build$3.onResolve({ filter: filter$1 }, ({ path: path$13 }) => {
|
@@ -11031,7 +11068,7 @@ function createOptimizeDepsIncludeResolver(environment) {
|
|
11031
11068
|
const resolve$5 = createBackCompatIdResolver(topLevelConfig, {
|
11032
11069
|
asSrc: false,
|
11033
11070
|
scan: true,
|
11034
|
-
packageCache: new Map()
|
11071
|
+
packageCache: /* @__PURE__ */ new Map()
|
11035
11072
|
});
|
11036
11073
|
return async (id) => {
|
11037
11074
|
const lastArrowIndex = id.lastIndexOf(">");
|
@@ -11066,7 +11103,7 @@ function expandGlobIds(id, config$2) {
|
|
11066
11103
|
ignore: ["node_modules"]
|
11067
11104
|
}).map((filePath) => {
|
11068
11105
|
if (exportsValue.startsWith("./")) filePath = "./" + filePath;
|
11069
|
-
const matched$1 = exportsValueGlobRe.exec(slash
|
11106
|
+
const matched$1 = exportsValueGlobRe.exec(slash(filePath));
|
11070
11107
|
if (matched$1) {
|
11071
11108
|
let allGlobSame = matched$1.length === 2;
|
11072
11109
|
if (!allGlobSame) {
|
@@ -11090,7 +11127,7 @@ function expandGlobIds(id, config$2) {
|
|
11090
11127
|
cwd: pkgData.dir,
|
11091
11128
|
expandDirectories: false,
|
11092
11129
|
ignore: ["node_modules"]
|
11093
|
-
}).map((match) => path.posix.join(pkgName, slash
|
11130
|
+
}).map((match) => path.posix.join(pkgName, slash(match)));
|
11094
11131
|
matched.unshift(pkgName);
|
11095
11132
|
return matched;
|
11096
11133
|
}
|
@@ -11271,7 +11308,7 @@ function runOptimizeDeps(environment, depsInfo) {
|
|
11271
11308
|
fs.writeFileSync(dataPath, stringifyDepsOptimizerMetadata(metadata, depsCacheDir));
|
11272
11309
|
const temporaryPath = depsCacheDir + getTempSuffix();
|
11273
11310
|
const depsCacheDirPresent = fs.existsSync(depsCacheDir);
|
11274
|
-
if (isWindows
|
11311
|
+
if (isWindows) {
|
11275
11312
|
if (depsCacheDirPresent) {
|
11276
11313
|
debug$14?.(import_picocolors$25.default.green(`renaming ${depsCacheDir} to ${temporaryPath}`));
|
11277
11314
|
await safeRename(depsCacheDir, temporaryPath);
|
@@ -11464,7 +11501,7 @@ function depsFromOptimizedDepInfo(depsInfo) {
|
|
11464
11501
|
return obj;
|
11465
11502
|
}
|
11466
11503
|
function getOptimizedDepPath(environment, id) {
|
11467
|
-
return normalizePath
|
11504
|
+
return normalizePath(path.resolve(getDepsCacheDir(environment), flattenId(id) + ".js"));
|
11468
11505
|
}
|
11469
11506
|
function getDepsCacheSuffix(environment) {
|
11470
11507
|
return environment.name === "client" ? "" : `_${environment.name}`;
|
@@ -11479,7 +11516,7 @@ function getTempSuffix() {
|
|
11479
11516
|
return "_temp_" + getHash(`${process.pid}:${Date.now().toString()}:${Math.random().toString(16).slice(2)}`);
|
11480
11517
|
}
|
11481
11518
|
function getDepsCacheDirPrefix(environment) {
|
11482
|
-
return normalizePath
|
11519
|
+
return normalizePath(path.resolve(environment.config.cacheDir, "deps"));
|
11483
11520
|
}
|
11484
11521
|
function createIsOptimizedDepFile(environment) {
|
11485
11522
|
const depsCacheDirPrefix = getDepsCacheDirPrefix(environment);
|
@@ -11488,15 +11525,15 @@ function createIsOptimizedDepFile(environment) {
|
|
11488
11525
|
function createIsOptimizedDepUrl(environment) {
|
11489
11526
|
const { root } = environment.config;
|
11490
11527
|
const depsCacheDir = getDepsCacheDirPrefix(environment);
|
11491
|
-
const depsCacheDirRelative = normalizePath
|
11492
|
-
const depsCacheDirPrefix = depsCacheDirRelative.startsWith("../") ? `/@fs/${removeLeadingSlash(normalizePath
|
11528
|
+
const depsCacheDirRelative = normalizePath(path.relative(root, depsCacheDir));
|
11529
|
+
const depsCacheDirPrefix = depsCacheDirRelative.startsWith("../") ? `/@fs/${removeLeadingSlash(normalizePath(depsCacheDir))}` : `/${depsCacheDirRelative}`;
|
11493
11530
|
return function isOptimizedDepUrl(url$6) {
|
11494
11531
|
return url$6.startsWith(depsCacheDirPrefix);
|
11495
11532
|
};
|
11496
11533
|
}
|
11497
11534
|
function parseDepsOptimizerMetadata(jsonMetadata, depsCacheDir) {
|
11498
11535
|
const { hash: hash$1, lockfileHash, configHash, browserHash, optimized, chunks } = JSON.parse(jsonMetadata, (key, value$1) => {
|
11499
|
-
if (key === "file" || key === "src") return normalizePath
|
11536
|
+
if (key === "file" || key === "src") return normalizePath(path.resolve(depsCacheDir, value$1));
|
11500
11537
|
return value$1;
|
11501
11538
|
});
|
11502
11539
|
if (!chunks || Object.values(optimized).some((depInfo) => !depInfo.fileHash)) return;
|
@@ -11544,20 +11581,20 @@ function stringifyDepsOptimizerMetadata(metadata, depsCacheDir) {
|
|
11544
11581
|
}])),
|
11545
11582
|
chunks: Object.fromEntries(Object.values(chunks).map(({ id, file }) => [id, { file }]))
|
11546
11583
|
}, (key, value$1) => {
|
11547
|
-
if (key === "file" || key === "src") return normalizePath
|
11584
|
+
if (key === "file" || key === "src") return normalizePath(path.relative(depsCacheDir, value$1));
|
11548
11585
|
return value$1;
|
11549
11586
|
}, 2);
|
11550
11587
|
}
|
11551
11588
|
function esbuildOutputFromId(outputs, id, cacheDirOutputPath) {
|
11552
11589
|
const cwd = process.cwd();
|
11553
11590
|
const flatId = flattenId(id) + ".js";
|
11554
|
-
const normalizedOutputPath = normalizePath
|
11591
|
+
const normalizedOutputPath = normalizePath(path.relative(cwd, path.join(cacheDirOutputPath, flatId)));
|
11555
11592
|
const output = outputs[normalizedOutputPath];
|
11556
11593
|
if (output) return output;
|
11557
|
-
for (const [key, value$1] of Object.entries(outputs)) if (normalizePath
|
11594
|
+
for (const [key, value$1] of Object.entries(outputs)) if (normalizePath(path.relative(cwd, key)) === normalizedOutputPath) return value$1;
|
11558
11595
|
}
|
11559
11596
|
async function extractExportsData(environment, filePath) {
|
11560
|
-
await init
|
11597
|
+
await init;
|
11561
11598
|
const { optimizeDeps: optimizeDeps$1 } = environment.config;
|
11562
11599
|
const esbuildOptions = optimizeDeps$1.esbuildOptions ?? {};
|
11563
11600
|
if (optimizeDeps$1.extensions?.some((ext) => filePath.endsWith(ext))) {
|
@@ -11567,7 +11604,7 @@ async function extractExportsData(environment, filePath) {
|
|
11567
11604
|
write: false,
|
11568
11605
|
format: "esm"
|
11569
11606
|
});
|
11570
|
-
const [, exports$2, , hasModuleSyntax$1] = parse
|
11607
|
+
const [, exports$2, , hasModuleSyntax$1] = parse(result.outputFiles[0].text);
|
11571
11608
|
return {
|
11572
11609
|
hasModuleSyntax: hasModuleSyntax$1,
|
11573
11610
|
exports: exports$2.map((e$1) => e$1.n)
|
@@ -11577,12 +11614,12 @@ async function extractExportsData(environment, filePath) {
|
|
11577
11614
|
let usedJsxLoader = false;
|
11578
11615
|
const entryContent = await fsp.readFile(filePath, "utf-8");
|
11579
11616
|
try {
|
11580
|
-
parseResult = parse
|
11617
|
+
parseResult = parse(entryContent);
|
11581
11618
|
} catch {
|
11582
11619
|
const loader$1 = esbuildOptions.loader?.[path.extname(filePath)] || "jsx";
|
11583
11620
|
debug$14?.(`Unable to parse: ${filePath}.\n Trying again with a ${loader$1} transform.`);
|
11584
11621
|
const transformed = await transformWithEsbuild(entryContent, filePath, { loader: loader$1 }, void 0, environment.config);
|
11585
|
-
parseResult = parse
|
11622
|
+
parseResult = parse(transformed.code);
|
11586
11623
|
usedJsxLoader = true;
|
11587
11624
|
}
|
11588
11625
|
const [, exports$1, , hasModuleSyntax] = parseResult;
|
@@ -11766,7 +11803,7 @@ const safeRename = promisify(function gracefulRename(from, to, cb) {
|
|
11766
11803
|
//#endregion
|
11767
11804
|
//#region src/node/external.ts
|
11768
11805
|
const debug$13 = createDebugger("vite:external");
|
11769
|
-
const isExternalCache = new WeakMap();
|
11806
|
+
const isExternalCache = /* @__PURE__ */ new WeakMap();
|
11770
11807
|
function shouldExternalize(environment, id, importer) {
|
11771
11808
|
let isExternal$1 = isExternalCache.get(environment);
|
11772
11809
|
if (!isExternal$1) {
|
@@ -11779,7 +11816,7 @@ function createIsConfiguredAsExternal(environment) {
|
|
11779
11816
|
const { config: config$2 } = environment;
|
11780
11817
|
const { root, resolve: resolve$5 } = config$2;
|
11781
11818
|
const { external, noExternal } = resolve$5;
|
11782
|
-
const noExternalFilter = typeof noExternal !== "boolean" && !(Array.isArray(noExternal) && noExternal.length === 0) && createFilter
|
11819
|
+
const noExternalFilter = typeof noExternal !== "boolean" && !(Array.isArray(noExternal) && noExternal.length === 0) && createFilter(void 0, noExternal, { resolve: false });
|
11783
11820
|
const targetConditions = resolve$5.externalConditions;
|
11784
11821
|
const resolveOptions = {
|
11785
11822
|
...resolve$5,
|
@@ -11793,7 +11830,7 @@ function createIsConfiguredAsExternal(environment) {
|
|
11793
11830
|
try {
|
11794
11831
|
const resolved = tryNodeResolve(id, config$2.command === "build" ? void 0 : importer, resolveOptions, void 0, false);
|
11795
11832
|
if (!resolved) return false;
|
11796
|
-
if (!configuredAsExternal && !isInNodeModules
|
11833
|
+
if (!configuredAsExternal && !isInNodeModules(resolved.id)) return false;
|
11797
11834
|
return canExternalizeFile(resolved.id);
|
11798
11835
|
} catch {
|
11799
11836
|
debug$13?.(`Failed to node resolve "${id}". Skipping externalizing it by default.`);
|
@@ -11811,7 +11848,7 @@ function createIsConfiguredAsExternal(environment) {
|
|
11811
11848
|
};
|
11812
11849
|
}
|
11813
11850
|
function createIsExternal(environment) {
|
11814
|
-
const processedIds = new Map();
|
11851
|
+
const processedIds = /* @__PURE__ */ new Map();
|
11815
11852
|
const isConfiguredAsExternal = createIsConfiguredAsExternal(environment);
|
11816
11853
|
return (id, importer) => {
|
11817
11854
|
if (processedIds.has(id)) return processedIds.get(id);
|
@@ -11829,8 +11866,8 @@ function canExternalizeFile(filePath) {
|
|
11829
11866
|
//#endregion
|
11830
11867
|
//#region src/node/plugins/resolve.ts
|
11831
11868
|
var import_picocolors$24 = __toESM(require_picocolors(), 1);
|
11832
|
-
const normalizedClientEntry$1 = normalizePath
|
11833
|
-
const normalizedEnvEntry$1 = normalizePath
|
11869
|
+
const normalizedClientEntry$1 = normalizePath(CLIENT_ENTRY);
|
11870
|
+
const normalizedEnvEntry$1 = normalizePath(ENV_ENTRY);
|
11834
11871
|
const ERR_RESOLVE_PACKAGE_ENTRY_FAIL = "ERR_RESOLVE_PACKAGE_ENTRY_FAIL";
|
11835
11872
|
const browserExternalId = "__vite-browser-external";
|
11836
11873
|
const optionalPeerDepId = "__vite-optional-peer-dep";
|
@@ -11857,11 +11894,11 @@ function resolvePlugin(resolveOptions) {
|
|
11857
11894
|
const resolvedImports = resolveSubpathImports(id, importer, options$1);
|
11858
11895
|
if (resolvedImports) {
|
11859
11896
|
id = resolvedImports;
|
11860
|
-
if (resolveOpts.custom?.["vite:import-glob"]?.isSubImportsPattern) return normalizePath
|
11897
|
+
if (resolveOpts.custom?.["vite:import-glob"]?.isSubImportsPattern) return normalizePath(path.join(root, id));
|
11861
11898
|
}
|
11862
11899
|
let res;
|
11863
11900
|
if (asSrc && depsOptimizer?.isOptimizedDepUrl(id)) {
|
11864
|
-
const optimizedPath = id.startsWith(FS_PREFIX) ? fsPathFromId(id) : normalizePath
|
11901
|
+
const optimizedPath = id.startsWith(FS_PREFIX) ? fsPathFromId(id) : normalizePath(path.resolve(root, id.slice(1)));
|
11865
11902
|
return optimizedPath;
|
11866
11903
|
}
|
11867
11904
|
if (asSrc && id.startsWith(FS_PREFIX)) {
|
@@ -11879,7 +11916,7 @@ function resolvePlugin(resolveOptions) {
|
|
11879
11916
|
if (id[0] === "." || (preferRelative || importer?.endsWith(".html")) && startsWithWordCharRE.test(id)) {
|
11880
11917
|
const basedir = importer ? path.dirname(importer) : process.cwd();
|
11881
11918
|
const fsPath = path.resolve(basedir, id);
|
11882
|
-
const normalizedFsPath = normalizePath
|
11919
|
+
const normalizedFsPath = normalizePath(fsPath);
|
11883
11920
|
if (depsOptimizer?.isOptimizedDepFile(normalizedFsPath)) {
|
11884
11921
|
if (!options$1.isBuild && !DEP_VERSION_RE.test(normalizedFsPath)) {
|
11885
11922
|
const browserHash = optimizedDepInfoFromFile(depsOptimizer.metadata, normalizedFsPath)?.browserHash;
|
@@ -11905,7 +11942,7 @@ function resolvePlugin(resolveOptions) {
|
|
11905
11942
|
const { file, postfix } = splitFileAndPostfix(id);
|
11906
11943
|
id = fileURLToPath(file) + postfix;
|
11907
11944
|
}
|
11908
|
-
if (isWindows
|
11945
|
+
if (isWindows && id[0] === "/") {
|
11909
11946
|
const basedir = importer ? path.dirname(importer) : process.cwd();
|
11910
11947
|
const fsPath = path.resolve(basedir, id);
|
11911
11948
|
if (res = tryFsResolve(fsPath, options$1)) {
|
@@ -11993,7 +12030,7 @@ function resolveSubpathImports(id, importer, options$1) {
|
|
11993
12030
|
}
|
11994
12031
|
function ensureVersionQuery(resolved, id, options$1, depsOptimizer) {
|
11995
12032
|
if (!options$1.isBuild && !options$1.scan && depsOptimizer && !(resolved === normalizedClientEntry$1 || resolved === normalizedEnvEntry$1)) {
|
11996
|
-
const isNodeModule = isInNodeModules
|
12033
|
+
const isNodeModule = isInNodeModules(id) || isInNodeModules(resolved);
|
11997
12034
|
if (isNodeModule && !DEP_VERSION_RE.test(resolved)) {
|
11998
12035
|
const versionHash = depsOptimizer.metadata.browserHash;
|
11999
12036
|
if (versionHash && isOptimizable(resolved, depsOptimizer.options)) resolved = injectQuery(resolved, `v=${versionHash}`);
|
@@ -12003,7 +12040,7 @@ function ensureVersionQuery(resolved, id, options$1, depsOptimizer) {
|
|
12003
12040
|
}
|
12004
12041
|
function tryFsResolve(fsPath, options$1, tryIndex = true, skipPackageJson = false) {
|
12005
12042
|
const hashIndex = fsPath.indexOf("#");
|
12006
|
-
if (hashIndex >= 0 && isInNodeModules
|
12043
|
+
if (hashIndex >= 0 && isInNodeModules(fsPath)) {
|
12007
12044
|
const queryIndex = fsPath.indexOf("?");
|
12008
12045
|
if (queryIndex < 0 || queryIndex > hashIndex) {
|
12009
12046
|
const file$1 = queryIndex > hashIndex ? fsPath.slice(0, queryIndex) : fsPath;
|
@@ -12110,10 +12147,10 @@ function tryNodeResolve(id, importer, options$1, depsOptimizer, externalize) {
|
|
12110
12147
|
id: resolved,
|
12111
12148
|
moduleSideEffects: pkg.hasSideEffects(resolved)
|
12112
12149
|
});
|
12113
|
-
if (!isInNodeModules
|
12150
|
+
if (!isInNodeModules(resolved) || !depsOptimizer || options$1.scan) return { id: resolved };
|
12114
12151
|
const isJsType = isOptimizable(resolved, depsOptimizer.options);
|
12115
12152
|
const exclude = depsOptimizer.options.exclude;
|
12116
|
-
const skipOptimization = depsOptimizer.options.noDiscovery || !isJsType || importer && isInNodeModules
|
12153
|
+
const skipOptimization = depsOptimizer.options.noDiscovery || !isJsType || importer && isInNodeModules(importer) || exclude?.includes(pkgId) || exclude?.includes(id) || SPECIAL_QUERY_RE.test(resolved);
|
12117
12154
|
if (skipOptimization) {
|
12118
12155
|
const versionHash = depsOptimizer.metadata.browserHash;
|
12119
12156
|
if (versionHash && isJsType) resolved = injectQuery(resolved, `v=${versionHash}`);
|
@@ -12139,7 +12176,7 @@ async function tryOptimizedResolve(depsOptimizer, id, importer, preserveSymlinks
|
|
12139
12176
|
if (!pkgName) break;
|
12140
12177
|
idPkgDir = resolvePackageData(pkgName, importer, preserveSymlinks, packageCache)?.dir;
|
12141
12178
|
if (idPkgDir == null) break;
|
12142
|
-
idPkgDir = normalizePath
|
12179
|
+
idPkgDir = normalizePath(idPkgDir);
|
12143
12180
|
}
|
12144
12181
|
if (optimizedData.src.startsWith(withTrailingSlash(idPkgDir))) return depsOptimizer.getOptimizedDepId(optimizedData);
|
12145
12182
|
}
|
@@ -12173,7 +12210,7 @@ function resolvePackageEntry(id, { dir, data, setResolvedCache, getResolvedCache
|
|
12173
12210
|
skipPackageJson = true;
|
12174
12211
|
} else {
|
12175
12212
|
const { browser: browserField } = data;
|
12176
|
-
if (options$1.mainFields.includes("browser") && isObject
|
12213
|
+
if (options$1.mainFields.includes("browser") && isObject(browserField)) entry = mapWithBrowserField(entry, browserField) || entry;
|
12177
12214
|
}
|
12178
12215
|
const entryPointPath = path.join(dir, entry);
|
12179
12216
|
const resolvedEntryPoint = tryFsResolve(entryPointPath, options$1, true, skipPackageJson);
|
@@ -12213,14 +12250,14 @@ function resolveDeepImport(id, { setResolvedCache, getResolvedCache, dir, data }
|
|
12213
12250
|
let relativeId = id;
|
12214
12251
|
const { exports: exportsField, browser: browserField } = data;
|
12215
12252
|
if (exportsField) {
|
12216
|
-
if (isObject
|
12253
|
+
if (isObject(exportsField) && !Array.isArray(exportsField)) {
|
12217
12254
|
const { file, postfix } = splitFileAndPostfix(relativeId);
|
12218
12255
|
const exportsId = resolveExportsOrImports(data, file, options$1, "exports");
|
12219
12256
|
if (exportsId !== void 0) relativeId = exportsId + postfix;
|
12220
12257
|
else relativeId = void 0;
|
12221
12258
|
} else relativeId = void 0;
|
12222
12259
|
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
|
12260
|
+
} else if (options$1.mainFields.includes("browser") && isObject(browserField)) {
|
12224
12261
|
const { file, postfix } = splitFileAndPostfix(relativeId);
|
12225
12262
|
const mapped = mapWithBrowserField(file, browserField);
|
12226
12263
|
if (mapped) relativeId = mapped + postfix;
|
@@ -12241,8 +12278,8 @@ function resolveDeepImport(id, { setResolvedCache, getResolvedCache, dir, data }
|
|
12241
12278
|
function tryResolveBrowserMapping(id, importer, options$1, isFilePath, externalize) {
|
12242
12279
|
let res;
|
12243
12280
|
const pkg = importer && findNearestPackageData(path.dirname(importer), options$1.packageCache);
|
12244
|
-
if (pkg && isObject
|
12245
|
-
const mapId = isFilePath ? "./" + slash
|
12281
|
+
if (pkg && isObject(pkg.data.browser)) {
|
12282
|
+
const mapId = isFilePath ? "./" + slash(path.relative(pkg.dir, id)) : id;
|
12246
12283
|
const browserMappedPath = mapWithBrowserField(mapId, pkg.data.browser);
|
12247
12284
|
if (browserMappedPath) {
|
12248
12285
|
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 +12302,7 @@ function tryResolveBrowserMapping(id, importer, options$1, isFilePath, externali
|
|
12265
12302
|
}
|
12266
12303
|
}
|
12267
12304
|
function tryResolveBrowserEntry(dir, data, options$1) {
|
12268
|
-
const browserEntry = typeof data.browser === "string" ? data.browser : isObject
|
12305
|
+
const browserEntry = typeof data.browser === "string" ? data.browser : isObject(data.browser) && data.browser["."];
|
12269
12306
|
if (browserEntry) if (!options$1.isRequire && options$1.mainFields.includes("module") && typeof data.module === "string" && data.module !== browserEntry) {
|
12270
12307
|
const resolvedBrowserEntry = tryFsResolve(path.join(dir, browserEntry), options$1);
|
12271
12308
|
if (resolvedBrowserEntry) {
|
@@ -12314,7 +12351,7 @@ function tryResolveRealFileOrType(file, preserveSymlinks) {
|
|
12314
12351
|
}
|
12315
12352
|
function getRealPath(resolved, preserveSymlinks) {
|
12316
12353
|
if (!preserveSymlinks) resolved = safeRealpathSync(resolved);
|
12317
|
-
return normalizePath
|
12354
|
+
return normalizePath(resolved);
|
12318
12355
|
}
|
12319
12356
|
function isDirectory(path$13) {
|
12320
12357
|
const stat$4 = tryStatSync(path$13);
|
@@ -12458,7 +12495,7 @@ var require_main$1 = __commonJS({ "../../node_modules/.pnpm/dotenv@16.5.0/node_m
|
|
12458
12495
|
const packageJson = require_package();
|
12459
12496
|
const version = packageJson.version;
|
12460
12497
|
const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;
|
12461
|
-
function parse$
|
12498
|
+
function parse$13(src) {
|
12462
12499
|
const obj = {};
|
12463
12500
|
let lines = src.toString();
|
12464
12501
|
lines = lines.replace(/\r\n?/gm, "\n");
|
@@ -12650,7 +12687,7 @@ var require_main$1 = __commonJS({ "../../node_modules/.pnpm/dotenv@16.5.0/node_m
|
|
12650
12687
|
_parseVault,
|
12651
12688
|
config,
|
12652
12689
|
decrypt,
|
12653
|
-
parse: parse$
|
12690
|
+
parse: parse$13,
|
12654
12691
|
populate
|
12655
12692
|
};
|
12656
12693
|
module.exports.configDotenv = DotenvModule.configDotenv;
|
@@ -12677,7 +12714,7 @@ var require_main = __commonJS({ "../../node_modules/.pnpm/dotenv-expand@12.0.2_p
|
|
12677
12714
|
const regex = /(?<!\\)\${([^{}]+)}|(?<!\\)\$([A-Za-z_][A-Za-z0-9_]*)/g;
|
12678
12715
|
let result = value$1;
|
12679
12716
|
let match;
|
12680
|
-
const seen$1 = new Set();
|
12717
|
+
const seen$1 = /* @__PURE__ */ new Set();
|
12681
12718
|
while ((match = regex.exec(result)) !== null) {
|
12682
12719
|
seen$1.add(result);
|
12683
12720
|
const [template, bracedExpression, unbracedExpression] = match;
|
@@ -12730,7 +12767,7 @@ function getEnvFilesForMode(mode, envDir) {
|
|
12730
12767
|
`.env.local`,
|
12731
12768
|
`.env.${mode}`,
|
12732
12769
|
`.env.${mode}.local`
|
12733
|
-
].map((file) => normalizePath
|
12770
|
+
].map((file) => normalizePath(path.join(envDir, file)));
|
12734
12771
|
return [];
|
12735
12772
|
}
|
12736
12773
|
function loadEnv(mode, envDir, prefixes = "VITE_") {
|
@@ -12917,7 +12954,7 @@ var require_ms = __commonJS({ "../../node_modules/.pnpm/ms@2.0.0/node_modules/ms
|
|
12917
12954
|
module.exports = function(val, options$1) {
|
12918
12955
|
options$1 = options$1 || {};
|
12919
12956
|
var type = typeof val;
|
12920
|
-
if (type === "string" && val.length > 0) return parse$
|
12957
|
+
if (type === "string" && val.length > 0) return parse$11(val);
|
12921
12958
|
else if (type === "number" && isNaN(val) === false) return options$1.long ? fmtLong(val) : fmtShort(val);
|
12922
12959
|
throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
|
12923
12960
|
};
|
@@ -12928,7 +12965,7 @@ var require_ms = __commonJS({ "../../node_modules/.pnpm/ms@2.0.0/node_modules/ms
|
|
12928
12965
|
* @return {Number}
|
12929
12966
|
* @api private
|
12930
12967
|
*/
|
12931
|
-
function parse$
|
12968
|
+
function parse$11(str) {
|
12932
12969
|
str = String(str);
|
12933
12970
|
if (str.length > 100) return;
|
12934
12971
|
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 +13093,7 @@ var require_debug$1 = __commonJS({ "../../node_modules/.pnpm/debug@2.6.9/node_mo
|
|
13056
13093
|
function debug$19() {
|
13057
13094
|
if (!debug$19.enabled) return;
|
13058
13095
|
var self$1 = debug$19;
|
13059
|
-
var curr =
|
13096
|
+
var curr = +/* @__PURE__ */ new Date();
|
13060
13097
|
var ms = curr - (prevTime || curr);
|
13061
13098
|
self$1.diff = ms;
|
13062
13099
|
self$1.prev = prevTime;
|
@@ -13158,7 +13195,7 @@ var require_node = __commonJS({ "../../node_modules/.pnpm/debug@2.6.9/node_modul
|
|
13158
13195
|
* Expose `debug()` as the module.
|
13159
13196
|
*/
|
13160
13197
|
exports = module.exports = require_debug$1();
|
13161
|
-
exports.init = init;
|
13198
|
+
exports.init = init$1;
|
13162
13199
|
exports.log = log;
|
13163
13200
|
exports.formatArgs = formatArgs;
|
13164
13201
|
exports.save = save;
|
@@ -13238,7 +13275,7 @@ var require_node = __commonJS({ "../../node_modules/.pnpm/debug@2.6.9/node_modul
|
|
13238
13275
|
var prefix$1 = " \x1B[3" + c + ";1m" + name + " \x1B[0m";
|
13239
13276
|
args[0] = prefix$1 + args[0].split("\n").join("\n" + prefix$1);
|
13240
13277
|
args.push("\x1B[3" + c + "m+" + exports.humanize(this.diff) + "\x1B[0m");
|
13241
|
-
} else args[0] = new Date().toUTCString() + " " + name + " " + args[0];
|
13278
|
+
} else args[0] = (/* @__PURE__ */ new Date()).toUTCString() + " " + name + " " + args[0];
|
13242
13279
|
}
|
13243
13280
|
/**
|
13244
13281
|
* Invokes `util.format()` with the specified arguments and writes to `stream`.
|
@@ -13310,7 +13347,7 @@ var require_node = __commonJS({ "../../node_modules/.pnpm/debug@2.6.9/node_modul
|
|
13310
13347
|
* Create a new `inspectOpts` object in case `useColors` is set
|
13311
13348
|
* differently for a particular `debug` instance.
|
13312
13349
|
*/
|
13313
|
-
function init(debug$19) {
|
13350
|
+
function init$1(debug$19) {
|
13314
13351
|
debug$19.inspectOpts = {};
|
13315
13352
|
var keys = Object.keys(exports.inspectOpts);
|
13316
13353
|
for (var i$1 = 0; i$1 < keys.length; i$1++) debug$19.inspectOpts[keys[i$1]] = exports.inspectOpts[keys[i$1]];
|
@@ -13636,7 +13673,7 @@ var require_parseurl = __commonJS({ "../../node_modules/.pnpm/parseurl@1.3.3/nod
|
|
13636
13673
|
* @private
|
13637
13674
|
*/
|
13638
13675
|
var url$4 = require("url");
|
13639
|
-
var parse$
|
13676
|
+
var parse$10 = url$4.parse;
|
13640
13677
|
var Url = url$4.Url;
|
13641
13678
|
/**
|
13642
13679
|
* Module exports.
|
@@ -13684,7 +13721,7 @@ var require_parseurl = __commonJS({ "../../node_modules/.pnpm/parseurl@1.3.3/nod
|
|
13684
13721
|
* @private
|
13685
13722
|
*/
|
13686
13723
|
function fastparse(str) {
|
13687
|
-
if (typeof str !== "string" || str.charCodeAt(0) !== 47) return parse$
|
13724
|
+
if (typeof str !== "string" || str.charCodeAt(0) !== 47) return parse$10(str);
|
13688
13725
|
var pathname = str;
|
13689
13726
|
var query = null;
|
13690
13727
|
var search = null;
|
@@ -13703,7 +13740,7 @@ var require_parseurl = __commonJS({ "../../node_modules/.pnpm/parseurl@1.3.3/nod
|
|
13703
13740
|
case 32:
|
13704
13741
|
case 35:
|
13705
13742
|
case 160:
|
13706
|
-
case 65279: return parse$
|
13743
|
+
case 65279: return parse$10(str);
|
13707
13744
|
}
|
13708
13745
|
var url$6 = Url !== void 0 ? new Url() : {};
|
13709
13746
|
url$6.path = str;
|
@@ -14440,11 +14477,11 @@ var require_vary = __commonJS({ "../../node_modules/.pnpm/vary@1.1.2/node_module
|
|
14440
14477
|
function append$1(header, field) {
|
14441
14478
|
if (typeof header !== "string") throw new TypeError("header argument is required");
|
14442
14479
|
if (!field) throw new TypeError("field argument is required");
|
14443
|
-
var fields = !Array.isArray(field) ? parse$
|
14480
|
+
var fields = !Array.isArray(field) ? parse$9(String(field)) : field;
|
14444
14481
|
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
14482
|
if (header === "*") return header;
|
14446
14483
|
var val = header;
|
14447
|
-
var vals = parse$
|
14484
|
+
var vals = parse$9(header.toLowerCase());
|
14448
14485
|
if (fields.indexOf("*") !== -1 || vals.indexOf("*") !== -1) return "*";
|
14449
14486
|
for (var i$1 = 0; i$1 < fields.length; i$1++) {
|
14450
14487
|
var fld = fields[i$1].toLowerCase();
|
@@ -14462,7 +14499,7 @@ var require_vary = __commonJS({ "../../node_modules/.pnpm/vary@1.1.2/node_module
|
|
14462
14499
|
* @return {Array}
|
14463
14500
|
* @private
|
14464
14501
|
*/
|
14465
|
-
function parse$
|
14502
|
+
function parse$9(header) {
|
14466
14503
|
var end = 0;
|
14467
14504
|
var list = [];
|
14468
14505
|
var start = 0;
|
@@ -14951,7 +14988,7 @@ var require_normalize_path = __commonJS({ "../../node_modules/.pnpm/normalize-pa
|
|
14951
14988
|
var require_anymatch = __commonJS({ "../../node_modules/.pnpm/anymatch@3.1.3/node_modules/anymatch/index.js"(exports, module) {
|
14952
14989
|
Object.defineProperty(exports, "__esModule", { value: true });
|
14953
14990
|
const picomatch$1 = require("picomatch");
|
14954
|
-
const normalizePath$
|
14991
|
+
const normalizePath$2 = require_normalize_path();
|
14955
14992
|
/**
|
14956
14993
|
* @typedef {(testString: string) => boolean} AnymatchFn
|
14957
14994
|
* @typedef {string|RegExp|AnymatchFn} AnymatchPattern
|
@@ -14985,7 +15022,7 @@ var require_anymatch = __commonJS({ "../../node_modules/.pnpm/anymatch@3.1.3/nod
|
|
14985
15022
|
const isList = Array.isArray(args);
|
14986
15023
|
const _path = isList ? args[0] : args;
|
14987
15024
|
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$
|
15025
|
+
const path$13 = normalizePath$2(_path, false);
|
14989
15026
|
for (let index = 0; index < negPatterns.length; index++) {
|
14990
15027
|
const nglob = negPatterns[index];
|
14991
15028
|
if (nglob(path$13)) return returnIndex ? -1 : false;
|
@@ -15144,7 +15181,7 @@ var require_glob_parent = __commonJS({ "../../node_modules/.pnpm/glob-parent@5.1
|
|
15144
15181
|
var isGlob$1 = require_is_glob();
|
15145
15182
|
var pathPosixDirname = require("path").posix.dirname;
|
15146
15183
|
var isWin32 = require("os").platform() === "win32";
|
15147
|
-
var slash = "/";
|
15184
|
+
var slash$1 = "/";
|
15148
15185
|
var backslash = /\\/g;
|
15149
15186
|
var enclosure = /[\{\[].*[\}\]]$/;
|
15150
15187
|
var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
|
@@ -15157,8 +15194,8 @@ var require_glob_parent = __commonJS({ "../../node_modules/.pnpm/glob-parent@5.1
|
|
15157
15194
|
*/
|
15158
15195
|
module.exports = function globParent$1(str, opts) {
|
15159
15196
|
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;
|
15197
|
+
if (options$1.flipBackslashes && isWin32 && str.indexOf(slash$1) < 0) str = str.replace(backslash, slash$1);
|
15198
|
+
if (enclosure.test(str)) str += slash$1;
|
15162
15199
|
str += "a";
|
15163
15200
|
do
|
15164
15201
|
str = pathPosixDirname(str);
|
@@ -15495,7 +15532,7 @@ var require_to_regex_range = __commonJS({ "../../node_modules/.pnpm/to-regex-ran
|
|
15495
15532
|
var require_fill_range = __commonJS({ "../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js"(exports, module) {
|
15496
15533
|
const util$1 = require("util");
|
15497
15534
|
const toRegexRange = require_to_regex_range();
|
15498
|
-
const isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
15535
|
+
const isObject$1 = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
15499
15536
|
const transform$1 = (toNumber) => {
|
15500
15537
|
return (value$1) => toNumber === true ? Number(value$1) : String(value$1);
|
15501
15538
|
};
|
@@ -15640,12 +15677,12 @@ var require_fill_range = __commonJS({ "../../node_modules/.pnpm/fill-range@7.1.1
|
|
15640
15677
|
if (end == null && isValidValue(start)) return [start];
|
15641
15678
|
if (!isValidValue(start) || !isValidValue(end)) return invalidRange(start, end, options$1);
|
15642
15679
|
if (typeof step === "function") return fill$2(start, end, 1, { transform: step });
|
15643
|
-
if (isObject(step)) return fill$2(start, end, 0, step);
|
15680
|
+
if (isObject$1(step)) return fill$2(start, end, 0, step);
|
15644
15681
|
let opts = { ...options$1 };
|
15645
15682
|
if (opts.capture === true) opts.wrap = true;
|
15646
15683
|
step = step || opts.step || 1;
|
15647
15684
|
if (!isNumber(step)) {
|
15648
|
-
if (step != null && !isObject(step)) return invalidStep(step, opts);
|
15685
|
+
if (step != null && !isObject$1(step)) return invalidStep(step, opts);
|
15649
15686
|
return fill$2(start, end, 1, step);
|
15650
15687
|
}
|
15651
15688
|
if (isNumber(start) && isNumber(end)) return fillNumbers(start, end, step, opts);
|
@@ -15833,7 +15870,7 @@ var require_parse$2 = __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_m
|
|
15833
15870
|
/**
|
15834
15871
|
* parse
|
15835
15872
|
*/
|
15836
|
-
const parse$
|
15873
|
+
const parse$8 = (input, options$1 = {}) => {
|
15837
15874
|
if (typeof input !== "string") throw new TypeError("Expected a string");
|
15838
15875
|
const opts = options$1 || {};
|
15839
15876
|
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
@@ -16109,7 +16146,7 @@ var require_parse$2 = __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_m
|
|
16109
16146
|
push$1({ type: "eos" });
|
16110
16147
|
return ast;
|
16111
16148
|
};
|
16112
|
-
module.exports = parse$
|
16149
|
+
module.exports = parse$8;
|
16113
16150
|
} });
|
16114
16151
|
|
16115
16152
|
//#endregion
|
@@ -16118,7 +16155,7 @@ var require_braces = __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_mo
|
|
16118
16155
|
const stringify = require_stringify();
|
16119
16156
|
const compile = require_compile();
|
16120
16157
|
const expand = require_expand();
|
16121
|
-
const parse$
|
16158
|
+
const parse$7 = require_parse$2();
|
16122
16159
|
/**
|
16123
16160
|
* Expand the given pattern or create a regex-compatible string.
|
16124
16161
|
*
|
@@ -16156,7 +16193,7 @@ var require_braces = __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_mo
|
|
16156
16193
|
* @return {Object} Returns an AST
|
16157
16194
|
* @api public
|
16158
16195
|
*/
|
16159
|
-
braces$1.parse = (input, options$1 = {}) => parse$
|
16196
|
+
braces$1.parse = (input, options$1 = {}) => parse$7(input, options$1);
|
16160
16197
|
/**
|
16161
16198
|
* Creates a braces string from an AST, or an AST node.
|
16162
16199
|
*
|
@@ -16595,7 +16632,7 @@ var require_nodefs_handler = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6
|
|
16595
16632
|
const sysPath$2 = require("path");
|
16596
16633
|
const { promisify: promisify$3 } = require("util");
|
16597
16634
|
const isBinaryPath = require_is_binary_path();
|
16598
|
-
const { isWindows: isWindows$
|
16635
|
+
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
16636
|
const THROTTLE_MODE_WATCH = "watch";
|
16600
16637
|
const open$1 = promisify$3(fs$9.open);
|
16601
16638
|
const stat$2 = promisify$3(fs$9.stat);
|
@@ -16640,7 +16677,7 @@ var require_nodefs_handler = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6
|
|
16640
16677
|
/**
|
16641
16678
|
* @type {Map<String,FsWatchContainer>}
|
16642
16679
|
*/
|
16643
|
-
const FsWatchInstances = new Map();
|
16680
|
+
const FsWatchInstances = /* @__PURE__ */ new Map();
|
16644
16681
|
/**
|
16645
16682
|
* Instantiates the fs_watch interface
|
16646
16683
|
* @param {String} path to be watched
|
@@ -16704,7 +16741,7 @@ var require_nodefs_handler = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6
|
|
16704
16741
|
watcher.on(EV_ERROR$2, async (error$1) => {
|
16705
16742
|
const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
|
16706
16743
|
cont.watcherUnusable = true;
|
16707
|
-
if (isWindows$
|
16744
|
+
if (isWindows$3 && error$1.code === "EPERM") try {
|
16708
16745
|
const fd$1 = await open$1(path$13, "r");
|
16709
16746
|
await close(fd$1);
|
16710
16747
|
broadcastErr(error$1);
|
@@ -16732,7 +16769,7 @@ var require_nodefs_handler = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6
|
|
16732
16769
|
}
|
16733
16770
|
};
|
16734
16771
|
};
|
16735
|
-
const FsWatchFileInstances = new Map();
|
16772
|
+
const FsWatchFileInstances = /* @__PURE__ */ new Map();
|
16736
16773
|
/**
|
16737
16774
|
* Instantiates the fs_watchFile interface or binds listeners
|
16738
16775
|
* to an existing one covering the same file system entry
|
@@ -16745,8 +16782,8 @@ var require_nodefs_handler = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6
|
|
16745
16782
|
const setFsWatchFileListener = (path$13, fullPath, options$1, handlers) => {
|
16746
16783
|
const { listener: listener$1, rawEmitter } = handlers;
|
16747
16784
|
let cont = FsWatchFileInstances.get(fullPath);
|
16748
|
-
let listeners = new Set();
|
16749
|
-
let rawEmitters = new Set();
|
16785
|
+
let listeners = /* @__PURE__ */ new Set();
|
16786
|
+
let rawEmitters = /* @__PURE__ */ new Set();
|
16750
16787
|
const copts = cont && cont.options;
|
16751
16788
|
if (copts && (copts.persistent < options$1.persistent || copts.interval > options$1.interval)) {
|
16752
16789
|
listeners = cont.listeners;
|
@@ -16915,7 +16952,7 @@ var require_nodefs_handler = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6
|
|
16915
16952
|
if (!throttler) return;
|
16916
16953
|
}
|
16917
16954
|
const previous = this.fsw._getWatchedDir(wh.path);
|
16918
|
-
const current = new Set();
|
16955
|
+
const current = /* @__PURE__ */ new Set();
|
16919
16956
|
let stream$1 = this.fsw._readdirp(directory, {
|
16920
16957
|
fileFilter: (entry) => wh.filterPath(entry),
|
16921
16958
|
directoryFilter: (entry) => wh.filterDir(entry),
|
@@ -17094,7 +17131,7 @@ var require_fsevents_handler = __commonJS({ "../../node_modules/.pnpm/chokidar@3
|
|
17094
17131
|
* Object to hold per-process fsevents instances (may be shared across chokidar FSWatcher instances)
|
17095
17132
|
* @type {Map<Path,FsEventsWatchContainer>}
|
17096
17133
|
*/
|
17097
|
-
const FSEventsWatchers = new Map();
|
17134
|
+
const FSEventsWatchers = /* @__PURE__ */ new Map();
|
17098
17135
|
const consolidateThreshhold = 10;
|
17099
17136
|
const wrongEventFlags = new Set([
|
17100
17137
|
69888,
|
@@ -17403,10 +17440,10 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17403
17440
|
const globParent = require_glob_parent();
|
17404
17441
|
const isGlob = require_is_glob();
|
17405
17442
|
const braces = require_braces();
|
17406
|
-
const normalizePath = require_normalize_path();
|
17443
|
+
const normalizePath$1 = require_normalize_path();
|
17407
17444
|
const NodeFsHandler = require_nodefs_handler();
|
17408
17445
|
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$
|
17446
|
+
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
17447
|
const stat = promisify$1(fs$7.stat);
|
17411
17448
|
const readdir = promisify$1(fs$7.readdir);
|
17412
17449
|
/**
|
@@ -17476,7 +17513,7 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17476
17513
|
this.path = dir;
|
17477
17514
|
this._removeWatcher = removeWatcher;
|
17478
17515
|
/** @type {Set<Path>} */
|
17479
|
-
this.items = new Set();
|
17516
|
+
this.items = /* @__PURE__ */ new Set();
|
17480
17517
|
}
|
17481
17518
|
add(item) {
|
17482
17519
|
const { items } = this;
|
@@ -17591,16 +17628,16 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17591
17628
|
const opts = {};
|
17592
17629
|
if (_opts) Object.assign(opts, _opts);
|
17593
17630
|
/** @type {Map<String, DirEntry>} */
|
17594
|
-
this._watched = new Map();
|
17631
|
+
this._watched = /* @__PURE__ */ new Map();
|
17595
17632
|
/** @type {Map<String, Array>} */
|
17596
|
-
this._closers = new Map();
|
17633
|
+
this._closers = /* @__PURE__ */ new Map();
|
17597
17634
|
/** @type {Set<String>} */
|
17598
|
-
this._ignoredPaths = new Set();
|
17635
|
+
this._ignoredPaths = /* @__PURE__ */ new Set();
|
17599
17636
|
/** @type {Map<ThrottleType, Map>} */
|
17600
|
-
this._throttled = new Map();
|
17637
|
+
this._throttled = /* @__PURE__ */ new Map();
|
17601
17638
|
/** @type {Map<Path, String|Boolean>} */
|
17602
|
-
this._symlinkPaths = new Map();
|
17603
|
-
this._streams = new Set();
|
17639
|
+
this._symlinkPaths = /* @__PURE__ */ new Map();
|
17640
|
+
this._streams = /* @__PURE__ */ new Set();
|
17604
17641
|
this.closed = false;
|
17605
17642
|
if (undef(opts, "persistent")) opts.persistent = true;
|
17606
17643
|
if (undef(opts, "ignoreInitial")) opts.ignoreInitial = false;
|
@@ -17624,7 +17661,7 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17624
17661
|
const envInterval = process.env.CHOKIDAR_INTERVAL;
|
17625
17662
|
if (envInterval) opts.interval = Number.parseInt(envInterval, 10);
|
17626
17663
|
if (undef(opts, "atomic")) opts.atomic = !opts.usePolling && !opts.useFsEvents;
|
17627
|
-
if (opts.atomic) this._pendingUnlinks = new Map();
|
17664
|
+
if (opts.atomic) this._pendingUnlinks = /* @__PURE__ */ new Map();
|
17628
17665
|
if (undef(opts, "followSymlinks")) opts.followSymlinks = true;
|
17629
17666
|
if (undef(opts, "awaitWriteFinish")) opts.awaitWriteFinish = false;
|
17630
17667
|
if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {};
|
@@ -17632,7 +17669,7 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17632
17669
|
if (awf) {
|
17633
17670
|
if (!awf.stabilityThreshold) awf.stabilityThreshold = 2e3;
|
17634
17671
|
if (!awf.pollInterval) awf.pollInterval = 100;
|
17635
|
-
this._pendingWrites = new Map();
|
17672
|
+
this._pendingWrites = /* @__PURE__ */ new Map();
|
17636
17673
|
}
|
17637
17674
|
if (opts.ignored) opts.ignored = arrify(opts.ignored);
|
17638
17675
|
let readyCalls = 0;
|
@@ -17665,7 +17702,7 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17665
17702
|
if (cwd) paths = paths.map((path$13) => {
|
17666
17703
|
const absPath = getAbsolutePath(path$13, cwd);
|
17667
17704
|
if (disableGlobbing || !isGlob(path$13)) return absPath;
|
17668
|
-
return normalizePath(absPath);
|
17705
|
+
return normalizePath$1(absPath);
|
17669
17706
|
});
|
17670
17707
|
paths = paths.filter((path$13) => {
|
17671
17708
|
if (path$13.startsWith(BANG)) {
|
@@ -17777,7 +17814,7 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17777
17814
|
async _emit(event, path$13, val1, val2, val3) {
|
17778
17815
|
if (this.closed) return;
|
17779
17816
|
const opts = this.options;
|
17780
|
-
if (isWindows$
|
17817
|
+
if (isWindows$2) path$13 = sysPath.normalize(path$13);
|
17781
17818
|
if (opts.cwd) path$13 = sysPath.relative(opts.cwd, path$13);
|
17782
17819
|
/** @type Array<any> */
|
17783
17820
|
const args = [event, path$13];
|
@@ -17787,7 +17824,7 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17787
17824
|
const awf = opts.awaitWriteFinish;
|
17788
17825
|
let pw;
|
17789
17826
|
if (awf && (pw = this._pendingWrites.get(path$13))) {
|
17790
|
-
pw.lastChange = new Date();
|
17827
|
+
pw.lastChange = /* @__PURE__ */ new Date();
|
17791
17828
|
return this;
|
17792
17829
|
}
|
17793
17830
|
if (opts.atomic) {
|
@@ -17856,7 +17893,7 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17856
17893
|
* @returns {Object|false} tracking object or false if action should be suppressed
|
17857
17894
|
*/
|
17858
17895
|
_throttle(actionType, path$13, timeout) {
|
17859
|
-
if (!this._throttled.has(actionType)) this._throttled.set(actionType, new Map());
|
17896
|
+
if (!this._throttled.has(actionType)) this._throttled.set(actionType, /* @__PURE__ */ new Map());
|
17860
17897
|
/** @type {Map<Path, Object>} */
|
17861
17898
|
const action = this._throttled.get(actionType);
|
17862
17899
|
/** @type {Object} */
|
@@ -17898,14 +17935,14 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0_pat
|
|
17898
17935
|
let timeoutHandler;
|
17899
17936
|
let fullPath = path$13;
|
17900
17937
|
if (this.options.cwd && !sysPath.isAbsolute(path$13)) fullPath = sysPath.join(this.options.cwd, path$13);
|
17901
|
-
const now = new Date();
|
17938
|
+
const now = /* @__PURE__ */ new Date();
|
17902
17939
|
const awaitWriteFinish = (prevStat) => {
|
17903
17940
|
fs$7.stat(fullPath, (err$2, curStat) => {
|
17904
17941
|
if (err$2 || !this._pendingWrites.has(path$13)) {
|
17905
17942
|
if (err$2 && err$2.code !== "ENOENT") awfEmit(err$2);
|
17906
17943
|
return;
|
17907
17944
|
}
|
17908
|
-
const now$1 = Number(new Date());
|
17945
|
+
const now$1 = Number(/* @__PURE__ */ new Date());
|
17909
17946
|
if (prevStat && curStat.size !== prevStat.size) this._pendingWrites.get(path$13).lastChange = now$1;
|
17910
17947
|
const pw = this._pendingWrites.get(path$13);
|
17911
17948
|
const df = now$1 - pw.lastChange;
|
@@ -18714,7 +18751,7 @@ function ssrRewriteStacktrace(stack, moduleGraph) {
|
|
18714
18751
|
const rawSourceMap = mod?.transformResult?.map;
|
18715
18752
|
if (!rawSourceMap) return input;
|
18716
18753
|
const traced = new TraceMap(rawSourceMap);
|
18717
|
-
const pos = originalPositionFor
|
18754
|
+
const pos = originalPositionFor(traced, {
|
18718
18755
|
line: Number(line$1) - offset,
|
18719
18756
|
column: Number(column) - 1
|
18720
18757
|
});
|
@@ -18737,7 +18774,7 @@ function rebindErrorStacktrace(e$1, stacktrace) {
|
|
18737
18774
|
});
|
18738
18775
|
else if (writable) e$1.stack = stacktrace;
|
18739
18776
|
}
|
18740
|
-
const rewroteStacktraces = new WeakSet();
|
18777
|
+
const rewroteStacktraces = /* @__PURE__ */ new WeakSet();
|
18741
18778
|
function ssrFixStacktrace(e$1, moduleGraph) {
|
18742
18779
|
if (!e$1.stack) return;
|
18743
18780
|
if (rewroteStacktraces.has(e$1)) return;
|
@@ -18809,7 +18846,7 @@ var import_picocolors$19 = __toESM(require_picocolors(), 1);
|
|
18809
18846
|
async function ssrLoadModule(url$6, server, fixStacktrace) {
|
18810
18847
|
const environment = server.environments.ssr;
|
18811
18848
|
server._ssrCompatModuleRunner ||= new SSRCompatModuleRunner(environment);
|
18812
|
-
url$6 = unwrapId
|
18849
|
+
url$6 = unwrapId(url$6);
|
18813
18850
|
return instantiateModule(url$6, server._ssrCompatModuleRunner, environment, fixStacktrace);
|
18814
18851
|
}
|
18815
18852
|
async function instantiateModule(url$6, runner, environment, fixStacktrace) {
|
@@ -19075,7 +19112,7 @@ function isNode(value$1) {
|
|
19075
19112
|
* }} walker
|
19076
19113
|
* @returns {Node | null}
|
19077
19114
|
*/
|
19078
|
-
function walk
|
19115
|
+
function walk(ast, { enter, leave }) {
|
19079
19116
|
const instance = new SyncWalker(enter, leave);
|
19080
19117
|
return instance.visit(ast, null);
|
19081
19118
|
}
|
@@ -19086,6 +19123,7 @@ const ssrModuleExportsKey = `__vite_ssr_exports__`;
|
|
19086
19123
|
const ssrImportKey = `__vite_ssr_import__`;
|
19087
19124
|
const ssrDynamicImportKey = `__vite_ssr_dynamic_import__`;
|
19088
19125
|
const ssrExportAllKey = `__vite_ssr_exportAll__`;
|
19126
|
+
const ssrExportNameKey = `__vite_ssr_exportName__`;
|
19089
19127
|
const ssrImportMetaKey = `__vite_ssr_import_meta__`;
|
19090
19128
|
const hashbangRE = /^#!.*\n/;
|
19091
19129
|
async function ssrTransform(code, inMap, url$6, originalCode, options$1) {
|
@@ -19120,10 +19158,10 @@ async function ssrTransformScript(code, inMap, url$6, originalCode) {
|
|
19120
19158
|
throw err$2;
|
19121
19159
|
}
|
19122
19160
|
let uid = 0;
|
19123
|
-
const deps = new Set();
|
19124
|
-
const dynamicDeps = new Set();
|
19125
|
-
const idToImportMap = new Map();
|
19126
|
-
const declaredConst = new Set();
|
19161
|
+
const deps = /* @__PURE__ */ new Set();
|
19162
|
+
const dynamicDeps = /* @__PURE__ */ new Set();
|
19163
|
+
const idToImportMap = /* @__PURE__ */ new Map();
|
19164
|
+
const declaredConst = /* @__PURE__ */ new Set();
|
19127
19165
|
const fileStartIndex = hashbangRE.exec(code)?.[0].length ?? 0;
|
19128
19166
|
let hoistIndex = fileStartIndex;
|
19129
19167
|
function defineImport(index, importNode, metadata) {
|
@@ -19138,11 +19176,11 @@ async function ssrTransformScript(code, inMap, url$6, originalCode) {
|
|
19138
19176
|
return importId;
|
19139
19177
|
}
|
19140
19178
|
function defineExport(name, local = name) {
|
19141
|
-
s$2.appendLeft(fileStartIndex,
|
19179
|
+
s$2.appendLeft(fileStartIndex, `${ssrExportNameKey}(${JSON.stringify(name)}, () => { try { return ${local} } catch {} });\n`);
|
19142
19180
|
}
|
19143
19181
|
const imports = [];
|
19144
19182
|
const exports$1 = [];
|
19145
|
-
const reExportImportIdMap = new Map();
|
19183
|
+
const reExportImportIdMap = /* @__PURE__ */ new Map();
|
19146
19184
|
for (const node of ast.body) if (node.type === "ImportDeclaration") imports.push(node);
|
19147
19185
|
else if (node.type === "ExportDefaultDeclaration") exports$1.push(node);
|
19148
19186
|
else if (node.type === "ExportNamedDeclaration" || node.type === "ExportAllDeclaration") {
|
@@ -19217,7 +19255,7 @@ async function ssrTransformScript(code, inMap, url$6, originalCode) {
|
|
19217
19255
|
} else s$2.appendLeft(node.end, `${ssrExportAllKey}(${importId});\n`);
|
19218
19256
|
}
|
19219
19257
|
}
|
19220
|
-
walk(ast, {
|
19258
|
+
walk$1(ast, {
|
19221
19259
|
onStatements(statements) {
|
19222
19260
|
for (let i$1 = 0; i$1 < statements.length - 1; i$1++) {
|
19223
19261
|
const stmt = statements[i$1];
|
@@ -19269,23 +19307,23 @@ async function ssrTransformScript(code, inMap, url$6, originalCode) {
|
|
19269
19307
|
function getIdentifierNameOrLiteralValue$1(node) {
|
19270
19308
|
return node.type === "Identifier" ? node.name : node.value;
|
19271
19309
|
}
|
19272
|
-
const isNodeInPatternWeakSet = new WeakSet();
|
19310
|
+
const isNodeInPatternWeakSet = /* @__PURE__ */ new WeakSet();
|
19273
19311
|
const setIsNodeInPattern = (node) => isNodeInPatternWeakSet.add(node);
|
19274
19312
|
const isNodeInPattern = (node) => isNodeInPatternWeakSet.has(node);
|
19275
19313
|
/**
|
19276
19314
|
* Same logic from \@vue/compiler-core & \@vue/compiler-sfc
|
19277
19315
|
* Except this is using acorn AST
|
19278
19316
|
*/
|
19279
|
-
function walk(root, { onIdentifier, onImportMeta, onDynamicImport, onStatements }) {
|
19317
|
+
function walk$1(root, { onIdentifier, onImportMeta, onDynamicImport, onStatements }) {
|
19280
19318
|
const parentStack = [];
|
19281
19319
|
const varKindStack = [];
|
19282
|
-
const scopeMap = new WeakMap();
|
19320
|
+
const scopeMap = /* @__PURE__ */ new WeakMap();
|
19283
19321
|
const identifiers = [];
|
19284
19322
|
const setScope = (node, name) => {
|
19285
19323
|
let scopeIds = scopeMap.get(node);
|
19286
19324
|
if (scopeIds && scopeIds.has(name)) return;
|
19287
19325
|
if (!scopeIds) {
|
19288
|
-
scopeIds = new Set();
|
19326
|
+
scopeIds = /* @__PURE__ */ new Set();
|
19289
19327
|
scopeMap.set(node, scopeIds);
|
19290
19328
|
}
|
19291
19329
|
scopeIds.add(name);
|
@@ -19306,7 +19344,7 @@ function walk(root, { onIdentifier, onImportMeta, onDynamicImport, onStatements
|
|
19306
19344
|
else if (p$1.type === "AssignmentPattern") handlePattern(p$1.left, parentScope);
|
19307
19345
|
else setScope(parentScope, p$1.name);
|
19308
19346
|
}
|
19309
|
-
walk
|
19347
|
+
walk(root, {
|
19310
19348
|
enter(node, parent) {
|
19311
19349
|
if (node.type === "ImportDeclaration") return this.skip();
|
19312
19350
|
if (node.type === "Program" || node.type === "BlockStatement" || node.type === "StaticBlock") onStatements(node.body);
|
@@ -19328,7 +19366,7 @@ function walk(root, { onIdentifier, onImportMeta, onDynamicImport, onStatements
|
|
19328
19366
|
handlePattern(p$1, node);
|
19329
19367
|
return;
|
19330
19368
|
}
|
19331
|
-
walk
|
19369
|
+
walk(p$1.type === "AssignmentPattern" ? p$1.left : p$1, { enter(child, parent$1) {
|
19332
19370
|
if (parent$1?.type === "AssignmentPattern" && parent$1.right === child) return this.skip();
|
19333
19371
|
if (child.type !== "Identifier") return;
|
19334
19372
|
if (isStaticPropertyKey(child, parent$1)) return;
|
@@ -19925,17 +19963,17 @@ var require_isexe = __commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modu
|
|
19925
19963
|
//#endregion
|
19926
19964
|
//#region ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
|
19927
19965
|
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";
|
19966
|
+
const isWindows$1 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
19929
19967
|
const path$4 = require("path");
|
19930
|
-
const COLON = isWindows ? ";" : ":";
|
19968
|
+
const COLON = isWindows$1 ? ";" : ":";
|
19931
19969
|
const isexe = require_isexe();
|
19932
19970
|
const getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
19933
19971
|
const getPathInfo = (cmd, opt) => {
|
19934
19972
|
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) {
|
19973
|
+
const pathEnv = cmd.match(/\//) || isWindows$1 && cmd.match(/\\/) ? [""] : [...isWindows$1 ? [process.cwd()] : [], ...(opt.path || process.env.PATH || "").split(colon)];
|
19974
|
+
const pathExtExe = isWindows$1 ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
19975
|
+
const pathExt = isWindows$1 ? pathExtExe.split(colon) : [""];
|
19976
|
+
if (isWindows$1) {
|
19939
19977
|
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "") pathExt.unshift("");
|
19940
19978
|
}
|
19941
19979
|
return {
|
@@ -20143,7 +20181,7 @@ var require_parse = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/nod
|
|
20143
20181
|
}
|
20144
20182
|
return parsed;
|
20145
20183
|
}
|
20146
|
-
function parse$
|
20184
|
+
function parse$6(command, args, options$1) {
|
20147
20185
|
if (args && !Array.isArray(args)) {
|
20148
20186
|
options$1 = args;
|
20149
20187
|
args = null;
|
@@ -20162,7 +20200,7 @@ var require_parse = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/nod
|
|
20162
20200
|
};
|
20163
20201
|
return options$1.shell ? parsed : parseNonShell(parsed);
|
20164
20202
|
}
|
20165
|
-
module.exports = parse$
|
20203
|
+
module.exports = parse$6;
|
20166
20204
|
} });
|
20167
20205
|
|
20168
20206
|
//#endregion
|
@@ -20209,16 +20247,16 @@ var require_enoent = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/no
|
|
20209
20247
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
|
20210
20248
|
var require_cross_spawn = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports, module) {
|
20211
20249
|
const cp = require("child_process");
|
20212
|
-
const parse$
|
20250
|
+
const parse$5 = require_parse();
|
20213
20251
|
const enoent = require_enoent();
|
20214
20252
|
function spawn$1(command, args, options$1) {
|
20215
|
-
const parsed = parse$
|
20253
|
+
const parsed = parse$5(command, args, options$1);
|
20216
20254
|
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
20217
20255
|
enoent.hookChildProcess(spawned, parsed);
|
20218
20256
|
return spawned;
|
20219
20257
|
}
|
20220
20258
|
function spawnSync(command, args, options$1) {
|
20221
|
-
const parsed = parse$
|
20259
|
+
const parsed = parse$5(command, args, options$1);
|
20222
20260
|
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
20223
20261
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
20224
20262
|
return result;
|
@@ -20226,7 +20264,7 @@ var require_cross_spawn = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0
|
|
20226
20264
|
module.exports = spawn$1;
|
20227
20265
|
module.exports.spawn = spawn$1;
|
20228
20266
|
module.exports.sync = spawnSync;
|
20229
|
-
module.exports._parse = parse$
|
20267
|
+
module.exports._parse = parse$5;
|
20230
20268
|
module.exports._enoent = enoent;
|
20231
20269
|
} });
|
20232
20270
|
|
@@ -20317,7 +20355,7 @@ function bindCLIShortcuts(server, opts) {
|
|
20317
20355
|
const onInput = async (input) => {
|
20318
20356
|
if (actionRunning) return;
|
20319
20357
|
if (input === "h") {
|
20320
|
-
const loggedKeys = new Set();
|
20358
|
+
const loggedKeys = /* @__PURE__ */ new Set();
|
20321
20359
|
server.config.logger.info("\n Shortcuts");
|
20322
20360
|
for (const shortcut$1 of shortcuts) {
|
20323
20361
|
if (loggedKeys.has(shortcut$1.key)) continue;
|
@@ -20409,7 +20447,7 @@ function getResolvedOutDirs(root, outDir, outputOptions) {
|
|
20409
20447
|
}
|
20410
20448
|
function resolveEmptyOutDir(emptyOutDir, root, outDirs, logger) {
|
20411
20449
|
if (emptyOutDir != null) return emptyOutDir;
|
20412
|
-
for (const outDir of outDirs) if (!normalizePath
|
20450
|
+
for (const outDir of outDirs) if (!normalizePath(outDir).startsWith(withTrailingSlash(root))) {
|
20413
20451
|
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
20452
|
return false;
|
20415
20453
|
}
|
@@ -22377,7 +22415,7 @@ var require_extension = __commonJS({ "../../node_modules/.pnpm/ws@8.18.2/node_mo
|
|
22377
22415
|
* @return {Object} The parsed object
|
22378
22416
|
* @public
|
22379
22417
|
*/
|
22380
|
-
function parse$
|
22418
|
+
function parse$4(header) {
|
22381
22419
|
const offers = Object.create(null);
|
22382
22420
|
let params = Object.create(null);
|
22383
22421
|
let mustUnescape = false;
|
@@ -22492,7 +22530,7 @@ var require_extension = __commonJS({ "../../node_modules/.pnpm/ws@8.18.2/node_mo
|
|
22492
22530
|
}
|
22493
22531
|
module.exports = {
|
22494
22532
|
format: format$2,
|
22495
|
-
parse: parse$
|
22533
|
+
parse: parse$4
|
22496
22534
|
};
|
22497
22535
|
} });
|
22498
22536
|
|
@@ -22513,7 +22551,7 @@ var require_websocket = __commonJS({ "../../node_modules/.pnpm/ws@8.18.2/node_mo
|
|
22513
22551
|
const { isBlob } = require_validation();
|
22514
22552
|
const { BINARY_TYPES, EMPTY_BUFFER, GUID: GUID$1, kForOnEventAttribute, kListener, kStatusCode, kWebSocket: kWebSocket$1, NOOP: NOOP$1 } = require_constants$1();
|
22515
22553
|
const { EventTarget: { addEventListener, removeEventListener } } = require_event_target();
|
22516
|
-
const { format: format$1, parse: parse$
|
22554
|
+
const { format: format$1, parse: parse$3 } = require_extension();
|
22517
22555
|
const { toBuffer } = require_buffer_util();
|
22518
22556
|
const closeTimeout = 30 * 1e3;
|
22519
22557
|
const kAborted = Symbol("kAborted");
|
@@ -23059,7 +23097,7 @@ var require_websocket = __commonJS({ "../../node_modules/.pnpm/ws@8.18.2/node_mo
|
|
23059
23097
|
const defaultPort = isSecure ? 443 : 80;
|
23060
23098
|
const key = randomBytes(16).toString("base64");
|
23061
23099
|
const request = isSecure ? https$3.request : http$4.request;
|
23062
|
-
const protocolSet = new Set();
|
23100
|
+
const protocolSet = /* @__PURE__ */ new Set();
|
23063
23101
|
let perMessageDeflate;
|
23064
23102
|
opts.createConnection = opts.createConnection || (isSecure ? tlsConnect : netConnect);
|
23065
23103
|
opts.defaultPort = opts.defaultPort || defaultPort;
|
@@ -23180,7 +23218,7 @@ var require_websocket = __commonJS({ "../../node_modules/.pnpm/ws@8.18.2/node_mo
|
|
23180
23218
|
}
|
23181
23219
|
let extensions$1;
|
23182
23220
|
try {
|
23183
|
-
extensions$1 = parse$
|
23221
|
+
extensions$1 = parse$3(secWebSocketExtensions);
|
23184
23222
|
} catch (err$2) {
|
23185
23223
|
const message = "Invalid Sec-WebSocket-Extensions header";
|
23186
23224
|
abortHandshake$1(websocket, socket, message);
|
@@ -23597,8 +23635,8 @@ var require_subprotocol = __commonJS({ "../../node_modules/.pnpm/ws@8.18.2/node_
|
|
23597
23635
|
* @return {Set} The subprotocol names
|
23598
23636
|
* @public
|
23599
23637
|
*/
|
23600
|
-
function parse$
|
23601
|
-
const protocols = new Set();
|
23638
|
+
function parse$2(header) {
|
23639
|
+
const protocols = /* @__PURE__ */ new Set();
|
23602
23640
|
let start = -1;
|
23603
23641
|
let end = -1;
|
23604
23642
|
let i$1 = 0;
|
@@ -23623,7 +23661,7 @@ var require_subprotocol = __commonJS({ "../../node_modules/.pnpm/ws@8.18.2/node_
|
|
23623
23661
|
protocols.add(protocol);
|
23624
23662
|
return protocols;
|
23625
23663
|
}
|
23626
|
-
module.exports = { parse: parse$
|
23664
|
+
module.exports = { parse: parse$2 };
|
23627
23665
|
} });
|
23628
23666
|
|
23629
23667
|
//#endregion
|
@@ -23723,7 +23761,7 @@ var require_websocket_server = __commonJS({ "../../node_modules/.pnpm/ws@8.18.2/
|
|
23723
23761
|
}
|
23724
23762
|
if (options$1.perMessageDeflate === true) options$1.perMessageDeflate = {};
|
23725
23763
|
if (options$1.clientTracking) {
|
23726
|
-
this.clients = new Set();
|
23764
|
+
this.clients = /* @__PURE__ */ new Set();
|
23727
23765
|
this._shouldEmitClose = false;
|
23728
23766
|
}
|
23729
23767
|
this.options = options$1;
|
@@ -23832,7 +23870,7 @@ var require_websocket_server = __commonJS({ "../../node_modules/.pnpm/ws@8.18.2/
|
|
23832
23870
|
return;
|
23833
23871
|
}
|
23834
23872
|
const secWebSocketProtocol = req$4.headers["sec-websocket-protocol"];
|
23835
|
-
let protocols = new Set();
|
23873
|
+
let protocols = /* @__PURE__ */ new Set();
|
23836
23874
|
if (secWebSocketProtocol !== void 0) try {
|
23837
23875
|
protocols = subprotocol.parse(secWebSocketProtocol);
|
23838
23876
|
} catch (err$2) {
|
@@ -24048,7 +24086,7 @@ function isHostAllowedInternal(hostHeader, allowedHosts) {
|
|
24048
24086
|
}
|
24049
24087
|
return false;
|
24050
24088
|
}
|
24051
|
-
const cache = new WeakMap();
|
24089
|
+
const cache = /* @__PURE__ */ new WeakMap();
|
24052
24090
|
/**
|
24053
24091
|
* Check if the host contained in the host header is allowed.
|
24054
24092
|
*
|
@@ -24061,7 +24099,7 @@ function isHostAllowed(hostHeader, allowedHosts) {
|
|
24061
24099
|
if (hostHeader === void 0) return true;
|
24062
24100
|
let cachedAllowedHosts;
|
24063
24101
|
if (Object.isFrozen(allowedHosts)) {
|
24064
|
-
if (!cache.has(allowedHosts)) cache.set(allowedHosts, new Set());
|
24102
|
+
if (!cache.has(allowedHosts)) cache.set(allowedHosts, /* @__PURE__ */ new Set());
|
24065
24103
|
cachedAllowedHosts = cache.get(allowedHosts);
|
24066
24104
|
if (cachedAllowedHosts.has(hostHeader)) return true;
|
24067
24105
|
}
|
@@ -24119,7 +24157,7 @@ function createWebSocketServer(server, config$2, httpsOptions) {
|
|
24119
24157
|
if (config$2.server.ws === false) return {
|
24120
24158
|
[isWebSocketServer]: true,
|
24121
24159
|
get clients() {
|
24122
|
-
return new Set();
|
24160
|
+
return /* @__PURE__ */ new Set();
|
24123
24161
|
},
|
24124
24162
|
async close() {},
|
24125
24163
|
on: noop$2,
|
@@ -24134,14 +24172,14 @@ function createWebSocketServer(server, config$2, httpsOptions) {
|
|
24134
24172
|
send: noop$2
|
24135
24173
|
};
|
24136
24174
|
let wsHttpServer = void 0;
|
24137
|
-
const hmr = isObject
|
24175
|
+
const hmr = isObject(config$2.server.hmr) && config$2.server.hmr;
|
24138
24176
|
const hmrServer = hmr && hmr.server;
|
24139
24177
|
const hmrPort = hmr && hmr.port;
|
24140
24178
|
const portsAreCompatible = !hmrPort || hmrPort === config$2.server.port;
|
24141
24179
|
const wsServer = hmrServer || portsAreCompatible && server;
|
24142
24180
|
let hmrServerWsListener;
|
24143
|
-
const customListeners = new Map();
|
24144
|
-
const clientsMap = new WeakMap();
|
24181
|
+
const customListeners = /* @__PURE__ */ new Map();
|
24182
|
+
const clientsMap = /* @__PURE__ */ new WeakMap();
|
24145
24183
|
const port = hmrPort || 24678;
|
24146
24184
|
const host = hmr && hmr.host || void 0;
|
24147
24185
|
const allowedHosts = config$2.server.allowedHosts === true ? config$2.server.allowedHosts : Object.freeze([...config$2.server.allowedHosts]);
|
@@ -24261,7 +24299,7 @@ function createWebSocketServer(server, config$2, httpsOptions) {
|
|
24261
24299
|
});
|
24262
24300
|
},
|
24263
24301
|
on(event, fn) {
|
24264
|
-
if (!customListeners.has(event)) customListeners.set(event, new Set());
|
24302
|
+
if (!customListeners.has(event)) customListeners.set(event, /* @__PURE__ */ new Set());
|
24265
24303
|
customListeners.get(event).add(fn);
|
24266
24304
|
},
|
24267
24305
|
off(event, fn) {
|
@@ -25870,13 +25908,13 @@ var require_etag = __commonJS({ "../../node_modules/.pnpm/etag@1.8.1/node_module
|
|
25870
25908
|
var import_convert_source_map$1 = __toESM(require_convert_source_map(), 1);
|
25871
25909
|
var import_etag$1 = __toESM(require_etag(), 1);
|
25872
25910
|
const debug$3 = createDebugger("vite:send", { onlyWhenFocused: true });
|
25873
|
-
const alias = {
|
25911
|
+
const alias$1 = {
|
25874
25912
|
js: "text/javascript",
|
25875
25913
|
css: "text/css",
|
25876
25914
|
html: "text/html",
|
25877
25915
|
json: "application/json"
|
25878
25916
|
};
|
25879
|
-
function send
|
25917
|
+
function send(req$4, res, content, type, options$1) {
|
25880
25918
|
const { etag: etag$1 = (0, import_etag$1.default)(content, { weak: true }), cacheControl = "no-cache", headers, map: map$1 } = options$1;
|
25881
25919
|
if (res.writableEnded) return;
|
25882
25920
|
if (req$4.headers["if-none-match"] === etag$1) {
|
@@ -25884,7 +25922,7 @@ function send$1(req$4, res, content, type, options$1) {
|
|
25884
25922
|
res.end();
|
25885
25923
|
return;
|
25886
25924
|
}
|
25887
|
-
res.setHeader("Content-Type", alias[type] || type);
|
25925
|
+
res.setHeader("Content-Type", alias$1[type] || type);
|
25888
25926
|
res.setHeader("Cache-Control", cacheControl);
|
25889
25927
|
res.setHeader("Etag", etag$1);
|
25890
25928
|
if (headers) for (const name in headers) res.setHeader(name, headers[name]);
|
@@ -25892,7 +25930,7 @@ function send$1(req$4, res, content, type, options$1) {
|
|
25892
25930
|
if (type === "js" || type === "css") content = getCodeWithSourcemap(type, content.toString(), map$1);
|
25893
25931
|
} else if (type === "js" && (!map$1 || map$1.mappings !== "")) {
|
25894
25932
|
const code = content.toString();
|
25895
|
-
if (import_convert_source_map$1.
|
25933
|
+
if (import_convert_source_map$1.mapFileCommentRegex.test(code)) debug$3?.(`Skipped injecting fallback sourcemap for ${req$4.url}`);
|
25896
25934
|
else {
|
25897
25935
|
const urlWithoutTimestamp = removeTimestampQuery(req$4.url);
|
25898
25936
|
const ms = new MagicString(code);
|
@@ -25936,7 +25974,7 @@ function totalist(dir, callback, pre = "") {
|
|
25936
25974
|
* @param {Request} req
|
25937
25975
|
* @returns {ParsedURL|void}
|
25938
25976
|
*/
|
25939
|
-
function parse(req$4) {
|
25977
|
+
function parse$1(req$4) {
|
25940
25978
|
let raw = req$4.url;
|
25941
25979
|
if (raw == null) return;
|
25942
25980
|
let prev = req$4._parsedUrl;
|
@@ -26001,7 +26039,7 @@ function viaLocal(dir, isEtag, uri, extns, shouldServe) {
|
|
26001
26039
|
function is404(req$4, res) {
|
26002
26040
|
return res.statusCode = 404, res.end();
|
26003
26041
|
}
|
26004
|
-
function send(req$4, res, file, stats, headers) {
|
26042
|
+
function send$1(req$4, res, file, stats, headers) {
|
26005
26043
|
let code = 200, tmp, opts = {};
|
26006
26044
|
headers = { ...headers };
|
26007
26045
|
for (let key in headers) {
|
@@ -26044,7 +26082,7 @@ function toHeaders(name, stats, isEtag) {
|
|
26044
26082
|
if (isEtag) headers["ETag"] = `W/"${stats.size}-${stats.mtime.getTime()}"`;
|
26045
26083
|
return headers;
|
26046
26084
|
}
|
26047
|
-
function build_default
|
26085
|
+
function build_default(dir, opts = {}) {
|
26048
26086
|
dir = resolve(dir || ".");
|
26049
26087
|
let isNotFound = opts.onNoMatch || is404;
|
26050
26088
|
let setHeaders$1 = opts.setHeaders || noop;
|
@@ -26084,7 +26122,7 @@ function build_default$1(dir, opts = {}) {
|
|
26084
26122
|
let lookup$1 = opts.dev ? viaLocal.bind(0, dir, isEtag) : viaCache.bind(0, FILES);
|
26085
26123
|
return function(req$4, res, next) {
|
26086
26124
|
let extns = [""];
|
26087
|
-
let pathname = parse(req$4).pathname;
|
26125
|
+
let pathname = parse$1(req$4).pathname;
|
26088
26126
|
let val = req$4.headers["accept-encoding"] || "";
|
26089
26127
|
if (gzips && val.includes("gzip")) extns.unshift(...gzips);
|
26090
26128
|
if (brots && /(br|brotli)/i.test(val)) extns.unshift(...brots);
|
@@ -26100,7 +26138,7 @@ function build_default$1(dir, opts = {}) {
|
|
26100
26138
|
}
|
26101
26139
|
if (gzips || brots) res.setHeader("Vary", "Accept-Encoding");
|
26102
26140
|
setHeaders$1(res, pathname, data.stats);
|
26103
|
-
send(req$4, res, data.abs, data.stats, data.headers);
|
26141
|
+
send$1(req$4, res, data.abs, data.stats, data.headers);
|
26104
26142
|
};
|
26105
26143
|
}
|
26106
26144
|
|
@@ -26134,7 +26172,7 @@ const sirvOptions = ({ config: config$2, getHeaders, disableFsServeCheck }) => {
|
|
26134
26172
|
};
|
26135
26173
|
function servePublicMiddleware(server, publicFiles) {
|
26136
26174
|
const dir = server.config.publicDir;
|
26137
|
-
const serve = build_default
|
26175
|
+
const serve = build_default(dir, sirvOptions({
|
26138
26176
|
config: server.config,
|
26139
26177
|
getHeaders: () => server.config.server.headers,
|
26140
26178
|
disableFsServeCheck: true
|
@@ -26144,16 +26182,16 @@ function servePublicMiddleware(server, publicFiles) {
|
|
26144
26182
|
if (filePath.indexOf("%") !== -1) try {
|
26145
26183
|
filePath = decodeURI(filePath);
|
26146
26184
|
} catch {}
|
26147
|
-
return normalizePath
|
26185
|
+
return normalizePath(filePath);
|
26148
26186
|
};
|
26149
26187
|
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
|
26188
|
+
if (publicFiles && !publicFiles.has(toFilePath(req$4.url)) || isImportRequest(req$4.url) || isInternalRequest(req$4.url) || urlRE.test(req$4.url)) return next();
|
26151
26189
|
serve(req$4, res, next);
|
26152
26190
|
};
|
26153
26191
|
}
|
26154
26192
|
function serveStaticMiddleware(server) {
|
26155
26193
|
const dir = server.config.root;
|
26156
|
-
const serve = build_default
|
26194
|
+
const serve = build_default(dir, sirvOptions({
|
26157
26195
|
config: server.config,
|
26158
26196
|
getHeaders: () => server.config.server.headers
|
26159
26197
|
}));
|
@@ -26192,7 +26230,7 @@ function serveStaticMiddleware(server) {
|
|
26192
26230
|
};
|
26193
26231
|
}
|
26194
26232
|
function serveRawFsMiddleware(server) {
|
26195
|
-
const serveFromRoot = build_default
|
26233
|
+
const serveFromRoot = build_default("/", sirvOptions({
|
26196
26234
|
config: server.config,
|
26197
26235
|
getHeaders: () => server.config.server.headers
|
26198
26236
|
}));
|
@@ -26201,7 +26239,7 @@ function serveRawFsMiddleware(server) {
|
|
26201
26239
|
const url$6 = new URL(req$4.url, "http://example.com");
|
26202
26240
|
const pathname = decodeURI(url$6.pathname);
|
26203
26241
|
let newPathname = pathname.slice(FS_PREFIX.length);
|
26204
|
-
if (isWindows
|
26242
|
+
if (isWindows) newPathname = newPathname.replace(/^[A-Z]:/i, "");
|
26205
26243
|
url$6.pathname = encodeURI(newPathname);
|
26206
26244
|
req$4.url = url$6.href.slice(url$6.origin.length);
|
26207
26245
|
try {
|
@@ -26235,7 +26273,7 @@ function isFileLoadingAllowed(config$2, filePath) {
|
|
26235
26273
|
return false;
|
26236
26274
|
}
|
26237
26275
|
function checkLoadingAccess(config$2, path$13) {
|
26238
|
-
if (isFileLoadingAllowed(config$2, slash
|
26276
|
+
if (isFileLoadingAllowed(config$2, slash(path$13))) return "allowed";
|
26239
26277
|
if (isFileReadable(path$13)) return "denied";
|
26240
26278
|
return "fallback";
|
26241
26279
|
}
|
@@ -26288,7 +26326,7 @@ function transformRequest(environment, url$6, options$1 = {}) {
|
|
26288
26326
|
};
|
26289
26327
|
if (environment._closing && environment.config.dev.recoverable) throwClosedServerError();
|
26290
26328
|
const cacheKey = `${options$1.html ? "html:" : ""}${url$6}`;
|
26291
|
-
const timestamp =
|
26329
|
+
const timestamp = monotonicDateNow();
|
26292
26330
|
const pending = environment._pendingRequests.get(cacheKey);
|
26293
26331
|
if (pending) return environment.moduleGraph.getModuleByUrl(removeTimestampQuery(url$6)).then((module$1) => {
|
26294
26332
|
if (!module$1 || pending.timestamp > module$1.lastInvalidationTimestamp) return pending.request;
|
@@ -26385,7 +26423,7 @@ async function loadAndTransform(environment, id, url$6, options$1, timestamp, mo
|
|
26385
26423
|
}
|
26386
26424
|
} else {
|
26387
26425
|
debugLoad?.(`${timeFrom(loadStart)} [plugin] ${prettyUrl}`);
|
26388
|
-
if (isObject
|
26426
|
+
if (isObject(loadResult)) {
|
26389
26427
|
code = loadResult.code;
|
26390
26428
|
map$1 = loadResult.map;
|
26391
26429
|
} else code = loadResult;
|
@@ -26458,17 +26496,17 @@ async function handleModuleSoftInvalidation(environment, mod, timestamp) {
|
|
26458
26496
|
let result;
|
26459
26497
|
if (transformResult.ssr) result = transformResult;
|
26460
26498
|
else {
|
26461
|
-
await init
|
26499
|
+
await init;
|
26462
26500
|
const source = transformResult.code;
|
26463
26501
|
const s$2 = new MagicString(source);
|
26464
|
-
const [imports] = parse
|
26502
|
+
const [imports] = parse(source, mod.id || void 0);
|
26465
26503
|
for (const imp of imports) {
|
26466
26504
|
let rawUrl = source.slice(imp.s, imp.e);
|
26467
26505
|
if (rawUrl === "import.meta") continue;
|
26468
26506
|
const hasQuotes = rawUrl[0] === "\"" || rawUrl[0] === "'";
|
26469
26507
|
if (hasQuotes) rawUrl = rawUrl.slice(1, -1);
|
26470
26508
|
const urlWithoutTimestamp = removeTimestampQuery(rawUrl);
|
26471
|
-
const hmrUrl = unwrapId
|
26509
|
+
const hmrUrl = unwrapId(stripBase(removeImportQuery(urlWithoutTimestamp), environment.config.base));
|
26472
26510
|
for (const importedMod of mod.importedModules) {
|
26473
26511
|
if (importedMod.url !== hmrUrl) continue;
|
26474
26512
|
if (importedMod.lastHMRTimestamp > 0) {
|
@@ -26652,10 +26690,10 @@ const modulePreloadLinkRE = /[ \t]*<link[^>]*rel\s*=\s*(?:"modulepreload"|'modul
|
|
26652
26690
|
const importMapAppendRE = new RegExp([moduleScriptRE, modulePreloadLinkRE].map((r$2) => r$2.source).join("|"), "i");
|
26653
26691
|
const isHTMLProxy = (id) => isHtmlProxyRE.test(id);
|
26654
26692
|
const isHTMLRequest = (request) => htmlLangRE.test(request);
|
26655
|
-
const htmlProxyMap = new WeakMap();
|
26656
|
-
const htmlProxyResult = new Map();
|
26693
|
+
const htmlProxyMap = /* @__PURE__ */ new WeakMap();
|
26694
|
+
const htmlProxyResult = /* @__PURE__ */ new Map();
|
26657
26695
|
function htmlInlineProxyPlugin(config$2) {
|
26658
|
-
htmlProxyMap.set(config$2, new Map());
|
26696
|
+
htmlProxyMap.set(config$2, /* @__PURE__ */ new Map());
|
26659
26697
|
return {
|
26660
26698
|
name: "vite:html-inline-proxy",
|
26661
26699
|
resolveId: { handler(id) {
|
@@ -26666,7 +26704,7 @@ function htmlInlineProxyPlugin(config$2) {
|
|
26666
26704
|
if (proxyMatch) {
|
26667
26705
|
const index = Number(proxyMatch[1]);
|
26668
26706
|
const file = cleanUrl(id);
|
26669
|
-
const url$6 = file.replace(normalizePath
|
26707
|
+
const url$6 = file.replace(normalizePath(config$2.root), "");
|
26670
26708
|
const result = htmlProxyMap.get(config$2).get(url$6)?.[index];
|
26671
26709
|
if (result) return {
|
26672
26710
|
...result,
|
@@ -26678,7 +26716,7 @@ function htmlInlineProxyPlugin(config$2) {
|
|
26678
26716
|
};
|
26679
26717
|
}
|
26680
26718
|
function addToHTMLProxyCache(config$2, filePath, index, result) {
|
26681
|
-
if (!htmlProxyMap.get(config$2)) htmlProxyMap.set(config$2, new Map());
|
26719
|
+
if (!htmlProxyMap.get(config$2)) htmlProxyMap.set(config$2, /* @__PURE__ */ new Map());
|
26682
26720
|
if (!htmlProxyMap.get(config$2).get(filePath)) htmlProxyMap.get(config$2).set(filePath, []);
|
26683
26721
|
htmlProxyMap.get(config$2).get(filePath)[index] = result;
|
26684
26722
|
}
|
@@ -26691,7 +26729,7 @@ const noInlineLinkRels = new Set([
|
|
26691
26729
|
"apple-touch-startup-image",
|
26692
26730
|
"manifest"
|
26693
26731
|
]);
|
26694
|
-
const isAsyncScriptMap = new WeakMap();
|
26732
|
+
const isAsyncScriptMap = /* @__PURE__ */ new WeakMap();
|
26695
26733
|
function nodeIsElement(node) {
|
26696
26734
|
return node.nodeName[0] !== "#";
|
26697
26735
|
}
|
@@ -26701,7 +26739,7 @@ function traverseNodes(node, visitor) {
|
|
26701
26739
|
if (nodeIsElement(node) || node.nodeName === "#document" || node.nodeName === "#document-fragment") node.childNodes.forEach((childNode) => traverseNodes(childNode, visitor));
|
26702
26740
|
}
|
26703
26741
|
async function traverseHtml(html, filePath, visitor) {
|
26704
|
-
const { parse: parse$16 } = await import("./dep-
|
26742
|
+
const { parse: parse$16 } = await import("./dep-BO5GbxpL.js");
|
26705
26743
|
const ast = parse$16(html, {
|
26706
26744
|
scriptingEnabled: false,
|
26707
26745
|
sourceCodeLocationInfo: true,
|
@@ -26788,15 +26826,15 @@ function buildHtmlPlugin(config$2) {
|
|
26788
26826
|
preHooks.push(htmlEnvHook(config$2));
|
26789
26827
|
postHooks.push(injectNonceAttributeTagHook(config$2));
|
26790
26828
|
postHooks.push(postImportMapHook());
|
26791
|
-
const processedHtml = perEnvironmentState(() => new Map());
|
26829
|
+
const processedHtml = perEnvironmentState(() => /* @__PURE__ */ new Map());
|
26792
26830
|
const isExcludedUrl = (url$6) => url$6[0] === "#" || isExternalUrl(url$6) || isDataUrl(url$6);
|
26793
|
-
isAsyncScriptMap.set(config$2, new Map());
|
26831
|
+
isAsyncScriptMap.set(config$2, /* @__PURE__ */ new Map());
|
26794
26832
|
return {
|
26795
26833
|
name: "vite:build-html",
|
26796
26834
|
transform: { async handler(html, id) {
|
26797
26835
|
if (id.endsWith(".html")) {
|
26798
|
-
id = normalizePath
|
26799
|
-
const relativeUrlPath = normalizePath
|
26836
|
+
id = normalizePath(id);
|
26837
|
+
const relativeUrlPath = normalizePath(path.relative(config$2.root, id));
|
26800
26838
|
const publicPath = `/${relativeUrlPath}`;
|
26801
26839
|
const publicBase = getBaseInHTML(relativeUrlPath, config$2);
|
26802
26840
|
const publicToRelative = (filename) => publicBase + filename;
|
@@ -26861,7 +26899,7 @@ function buildHtmlPlugin(config$2) {
|
|
26861
26899
|
} else if (node.childNodes.length) {
|
26862
26900
|
const scriptNode = node.childNodes.pop();
|
26863
26901
|
const contents = scriptNode.value;
|
26864
|
-
const filePath = id.replace(normalizePath
|
26902
|
+
const filePath = id.replace(normalizePath(config$2.root), "");
|
26865
26903
|
addToHTMLProxyCache(config$2, filePath, inlineModuleIndex, { code: contents });
|
26866
26904
|
js += `\nimport "${id}?html-proxy&index=${inlineModuleIndex}.js"`;
|
26867
26905
|
shouldRemove = true;
|
@@ -26916,7 +26954,7 @@ function buildHtmlPlugin(config$2) {
|
|
26916
26954
|
if (inlineStyle) {
|
26917
26955
|
inlineModuleIndex++;
|
26918
26956
|
const code = inlineStyle.attr.value;
|
26919
|
-
const filePath = id.replace(normalizePath
|
26957
|
+
const filePath = id.replace(normalizePath(config$2.root), "");
|
26920
26958
|
addToHTMLProxyCache(config$2, filePath, inlineModuleIndex, { code });
|
26921
26959
|
js += `\nimport "${id}?html-proxy&inline-css&style-attr&index=${inlineModuleIndex}.css"`;
|
26922
26960
|
const hash$1 = getHash(cleanUrl(id));
|
@@ -26924,7 +26962,7 @@ function buildHtmlPlugin(config$2) {
|
|
26924
26962
|
}
|
26925
26963
|
if (node.nodeName === "style" && node.childNodes.length) {
|
26926
26964
|
const styleNode = node.childNodes.pop();
|
26927
|
-
const filePath = id.replace(normalizePath
|
26965
|
+
const filePath = id.replace(normalizePath(config$2.root), "");
|
26928
26966
|
inlineModuleIndex++;
|
26929
26967
|
addToHTMLProxyCache(config$2, filePath, inlineModuleIndex, { code: styleNode.value });
|
26930
26968
|
js += `\nimport "${id}?html-proxy&inline-css&index=${inlineModuleIndex}.css"`;
|
@@ -26958,9 +26996,9 @@ function buildHtmlPlugin(config$2) {
|
|
26958
26996
|
}
|
26959
26997
|
} },
|
26960
26998
|
async generateBundle(options$1, bundle) {
|
26961
|
-
const analyzedImportedCssFiles = new Map();
|
26962
|
-
const inlineEntryChunk = new Set();
|
26963
|
-
const getImportedChunks = (chunk, seen$1 = new Set()) => {
|
26999
|
+
const analyzedImportedCssFiles = /* @__PURE__ */ new Map();
|
27000
|
+
const inlineEntryChunk = /* @__PURE__ */ new Set();
|
27001
|
+
const getImportedChunks = (chunk, seen$1 = /* @__PURE__ */ new Set()) => {
|
26964
27002
|
const chunks = [];
|
26965
27003
|
chunk.imports.forEach((file) => {
|
26966
27004
|
const importee = bundle[file];
|
@@ -26999,7 +27037,7 @@ function buildHtmlPlugin(config$2) {
|
|
26999
27037
|
href: toOutputPath(file)
|
27000
27038
|
}
|
27001
27039
|
});
|
27002
|
-
const getCssFilesForChunk = (chunk, seenChunks = new Set(), seenCss = new Set()) => {
|
27040
|
+
const getCssFilesForChunk = (chunk, seenChunks = /* @__PURE__ */ new Set(), seenCss = /* @__PURE__ */ new Set()) => {
|
27003
27041
|
if (seenChunks.has(chunk.fileName)) return [];
|
27004
27042
|
seenChunks.add(chunk.fileName);
|
27005
27043
|
if (analyzedImportedCssFiles.has(chunk)) {
|
@@ -27024,7 +27062,7 @@ function buildHtmlPlugin(config$2) {
|
|
27024
27062
|
};
|
27025
27063
|
const getCssTagsForChunk = (chunk, toOutputPath) => getCssFilesForChunk(chunk).map((file) => toStyleSheetLinkTag(file, toOutputPath));
|
27026
27064
|
for (const [normalizedId, html] of processedHtml(this)) {
|
27027
|
-
const relativeUrlPath = normalizePath
|
27065
|
+
const relativeUrlPath = normalizePath(path.relative(config$2.root, normalizedId));
|
27028
27066
|
const assetsBase = getBaseInHTML(relativeUrlPath, config$2);
|
27029
27067
|
const toOutputFilePath = (filename, type) => {
|
27030
27068
|
if (isExternalUrl(filename)) return filename;
|
@@ -27034,7 +27072,7 @@ function buildHtmlPlugin(config$2) {
|
|
27034
27072
|
const toOutputPublicAssetFilePath = (filename) => toOutputFilePath(filename, "public");
|
27035
27073
|
const isAsync = isAsyncScriptMap.get(config$2).get(normalizedId);
|
27036
27074
|
let result = html;
|
27037
|
-
const chunk = Object.values(bundle).find((chunk$1) => chunk$1.type === "chunk" && chunk$1.isEntry && chunk$1.facadeModuleId && normalizePath
|
27075
|
+
const chunk = Object.values(bundle).find((chunk$1) => chunk$1.type === "chunk" && chunk$1.isEntry && chunk$1.facadeModuleId && normalizePath(chunk$1.facadeModuleId) === normalizedId);
|
27038
27076
|
let canInlineEntry = false;
|
27039
27077
|
if (chunk) {
|
27040
27078
|
if (options$1.format === "es" && isEntirelyImport(chunk.code)) canInlineEntry = true;
|
@@ -27092,10 +27130,10 @@ function buildHtmlPlugin(config$2) {
|
|
27092
27130
|
});
|
27093
27131
|
result = result.replace(publicAssetUrlRE, (_, fileHash) => {
|
27094
27132
|
const publicAssetPath = toOutputPublicAssetFilePath(getPublicAssetFilename(fileHash, config$2));
|
27095
|
-
return encodeURIPath(URL$1.canParse(publicAssetPath) ? publicAssetPath : normalizePath
|
27133
|
+
return encodeURIPath(URL$1.canParse(publicAssetPath) ? publicAssetPath : normalizePath(publicAssetPath));
|
27096
27134
|
});
|
27097
27135
|
if (chunk && canInlineEntry) inlineEntryChunk.add(chunk.fileName);
|
27098
|
-
const shortEmitName = normalizePath
|
27136
|
+
const shortEmitName = normalizePath(path.relative(config$2.root, normalizedId));
|
27099
27137
|
this.emitFile({
|
27100
27138
|
type: "asset",
|
27101
27139
|
originalFileName: normalizedId,
|
@@ -27144,7 +27182,7 @@ function preImportMapHook(config$2) {
|
|
27144
27182
|
const importMapAppendIndex = html.search(importMapAppendRE);
|
27145
27183
|
if (importMapAppendIndex < 0) return;
|
27146
27184
|
if (importMapAppendIndex < importMapIndex) {
|
27147
|
-
const relativeHtml = normalizePath
|
27185
|
+
const relativeHtml = normalizePath(path.relative(config$2.root, ctx.filename));
|
27148
27186
|
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
27187
|
}
|
27150
27188
|
};
|
@@ -27199,7 +27237,7 @@ function htmlEnvHook(config$2) {
|
|
27199
27237
|
if (key in env$2) return env$2[key];
|
27200
27238
|
else {
|
27201
27239
|
if (envPrefix.some((prefix$1) => key.startsWith(prefix$1))) {
|
27202
|
-
const relativeHtml = normalizePath
|
27240
|
+
const relativeHtml = normalizePath(path.relative(config$2.root, ctx.filename));
|
27203
27241
|
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
27242
|
}
|
27205
27243
|
return text;
|
@@ -27386,12 +27424,12 @@ var import_picocolors$11 = __toESM(require_picocolors(), 1);
|
|
27386
27424
|
const debugCache = createDebugger("vite:cache");
|
27387
27425
|
const knownIgnoreList = new Set(["/", "/favicon.ico"]);
|
27388
27426
|
const trailingQuerySeparatorsRE = /[?&]+$/;
|
27389
|
-
const urlRE = /[?&]url\b/;
|
27390
|
-
const rawRE = /[?&]raw\b/;
|
27427
|
+
const urlRE$1 = /[?&]url\b/;
|
27428
|
+
const rawRE$1 = /[?&]raw\b/;
|
27391
27429
|
const inlineRE$2 = /[?&]inline\b/;
|
27392
27430
|
const svgRE = /\.svg\b/;
|
27393
27431
|
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)) {
|
27432
|
+
if (rawRE$1.test(url$6) || urlRE$1.test(url$6) || inlineRE$2.test(url$6) || svgRE.test(url$6)) {
|
27395
27433
|
const servingAccessResult = checkServingAccess(url$6, server);
|
27396
27434
|
if (servingAccessResult === "denied") {
|
27397
27435
|
respondWithAccessDenied(url$6, server, res);
|
@@ -27448,11 +27486,11 @@ function transformMiddleware(server) {
|
|
27448
27486
|
if (isSourceMap) {
|
27449
27487
|
const depsOptimizer = environment.depsOptimizer;
|
27450
27488
|
if (depsOptimizer?.isOptimizedDepUrl(url$6)) {
|
27451
|
-
const sourcemapPath = url$6.startsWith(FS_PREFIX) ? fsPathFromId(url$6) : normalizePath
|
27489
|
+
const sourcemapPath = url$6.startsWith(FS_PREFIX) ? fsPathFromId(url$6) : normalizePath(path.resolve(server.config.root, url$6.slice(1)));
|
27452
27490
|
try {
|
27453
27491
|
const map$1 = JSON.parse(await fsp.readFile(sourcemapPath, "utf-8"));
|
27454
27492
|
applySourcemapIgnoreList(map$1, sourcemapPath, server.config.server.sourcemapIgnoreList, server.config.logger);
|
27455
|
-
return send
|
27493
|
+
return send(req$4, res, JSON.stringify(map$1), "json", { headers: server.config.server.headers });
|
27456
27494
|
} catch {
|
27457
27495
|
const dummySourceMap = {
|
27458
27496
|
version: 3,
|
@@ -27462,7 +27500,7 @@ function transformMiddleware(server) {
|
|
27462
27500
|
names: [],
|
27463
27501
|
mappings: ";;;;;;;;;"
|
27464
27502
|
};
|
27465
|
-
return send
|
27503
|
+
return send(req$4, res, JSON.stringify(dummySourceMap), "json", {
|
27466
27504
|
cacheControl: "no-cache",
|
27467
27505
|
headers: server.config.server.headers
|
27468
27506
|
});
|
@@ -27470,16 +27508,16 @@ function transformMiddleware(server) {
|
|
27470
27508
|
} else {
|
27471
27509
|
const originalUrl = url$6.replace(/\.map($|\?)/, "$1");
|
27472
27510
|
const map$1 = (await environment.moduleGraph.getModuleByUrl(originalUrl))?.transformResult?.map;
|
27473
|
-
if (map$1) return send
|
27511
|
+
if (map$1) return send(req$4, res, JSON.stringify(map$1), "json", { headers: server.config.server.headers });
|
27474
27512
|
else return next();
|
27475
27513
|
}
|
27476
27514
|
}
|
27477
27515
|
if (publicDirInRoot && url$6.startsWith(publicPath)) warnAboutExplicitPublicPathInUrl(url$6);
|
27478
27516
|
const urlWithoutTrailingQuerySeparators = url$6.replace(trailingQuerySeparatorsRE, "");
|
27479
|
-
if (deniedServingAccessForTransform(urlWithoutTrailingQuerySeparators, server, res, next)) return;
|
27517
|
+
if (!url$6.startsWith("/@id/\0") && deniedServingAccessForTransform(urlWithoutTrailingQuerySeparators, server, res, next)) return;
|
27480
27518
|
if (req$4.headers["sec-fetch-dest"] === "script" || isJSRequest(url$6) || isImportRequest(url$6) || isCSSRequest(url$6) || isHTMLProxy(url$6)) {
|
27481
27519
|
url$6 = removeImportQuery(url$6);
|
27482
|
-
url$6 = unwrapId
|
27520
|
+
url$6 = unwrapId(url$6);
|
27483
27521
|
if (isCSSRequest(url$6)) {
|
27484
27522
|
if (req$4.headers.accept?.includes("text/css") && !isDirectRequest(url$6)) url$6 = injectQuery(url$6, "direct");
|
27485
27523
|
const ifNoneMatch = req$4.headers["if-none-match"];
|
@@ -27492,14 +27530,14 @@ function transformMiddleware(server) {
|
|
27492
27530
|
const result = await transformRequest(environment, url$6, {
|
27493
27531
|
html: req$4.headers.accept?.includes("text/html"),
|
27494
27532
|
allowId(id) {
|
27495
|
-
return !deniedServingAccessForTransform(id, server, res, next);
|
27533
|
+
return id.startsWith("\0") || !deniedServingAccessForTransform(id, server, res, next);
|
27496
27534
|
}
|
27497
27535
|
});
|
27498
27536
|
if (result) {
|
27499
27537
|
const depsOptimizer = environment.depsOptimizer;
|
27500
27538
|
const type = isDirectCSSRequest(url$6) ? "css" : "js";
|
27501
27539
|
const isDep = DEP_VERSION_RE.test(url$6) || depsOptimizer?.isOptimizedDepUrl(url$6);
|
27502
|
-
return send
|
27540
|
+
return send(req$4, res, result.code, type, {
|
27503
27541
|
etag: result.etag,
|
27504
27542
|
cacheControl: isDep ? "max-age=31536000,immutable" : "no-cache",
|
27505
27543
|
headers: server.config.server.headers,
|
@@ -27551,7 +27589,7 @@ function transformMiddleware(server) {
|
|
27551
27589
|
let warning;
|
27552
27590
|
if (isImportRequest(url$6)) {
|
27553
27591
|
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, "/"))}.`;
|
27592
|
+
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
27593
|
else warning = `Assets in public directory cannot be imported from JavaScript.
|
27556
27594
|
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
27595
|
} 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 +27627,7 @@ function createDevHtmlTransformFn(config$2) {
|
|
27589
27627
|
}
|
27590
27628
|
function getHtmlFilename(url$6, server) {
|
27591
27629
|
if (url$6.startsWith(FS_PREFIX)) return decodeURIComponent(fsPathFromId(url$6));
|
27592
|
-
else return decodeURIComponent(normalizePath
|
27630
|
+
else return decodeURIComponent(normalizePath(path.join(server.config.root, url$6.slice(1))));
|
27593
27631
|
}
|
27594
27632
|
function shouldPreTransform(url$6, config$2) {
|
27595
27633
|
return !checkPublicFile(url$6, config$2) && (isJSRequest(url$6) || isCSSRequest(url$6));
|
@@ -27636,12 +27674,12 @@ const devHtmlHook = async (html, { path: htmlPath, filename, server, originalUrl
|
|
27636
27674
|
} else {
|
27637
27675
|
const validPath = `${htmlPath}${trailingSlash ? "index.html" : ""}`;
|
27638
27676
|
proxyModulePath = `\0${validPath}`;
|
27639
|
-
proxyModuleUrl = wrapId
|
27677
|
+
proxyModuleUrl = wrapId(proxyModulePath);
|
27640
27678
|
}
|
27641
27679
|
proxyModuleUrl = joinUrlSegments(decodedBase, proxyModuleUrl);
|
27642
27680
|
const s$2 = new MagicString(html);
|
27643
27681
|
let inlineModuleIndex = -1;
|
27644
|
-
const proxyCacheUrl = decodeURI(cleanUrl(proxyModulePath).replace(normalizePath
|
27682
|
+
const proxyCacheUrl = decodeURI(cleanUrl(proxyModulePath).replace(normalizePath(config$2.root), ""));
|
27645
27683
|
const styleUrl = [];
|
27646
27684
|
const inlineStyles = [];
|
27647
27685
|
const inlineModulePaths = [];
|
@@ -27757,7 +27795,7 @@ function indexHtmlMiddleware(root, server) {
|
|
27757
27795
|
try {
|
27758
27796
|
let html = await fsp.readFile(filePath, "utf-8");
|
27759
27797
|
if (isDev) html = await server.transformIndexHtml(url$6, html, req$4.originalUrl);
|
27760
|
-
return send
|
27798
|
+
return send(req$4, res, html, "html", { headers });
|
27761
27799
|
} catch (e$1) {
|
27762
27800
|
return next(e$1);
|
27763
27801
|
}
|
@@ -27768,7 +27806,7 @@ function indexHtmlMiddleware(root, server) {
|
|
27768
27806
|
}
|
27769
27807
|
function preTransformRequest(server, decodedUrl, decodedBase) {
|
27770
27808
|
if (!server.config.server.preTransformRequests) return;
|
27771
|
-
decodedUrl = unwrapId
|
27809
|
+
decodedUrl = unwrapId(stripBase(decodedUrl, decodedBase));
|
27772
27810
|
server.warmupRequest(decodedUrl);
|
27773
27811
|
}
|
27774
27812
|
|
@@ -27813,12 +27851,12 @@ var ModuleNode = class {
|
|
27813
27851
|
if (this._ssrModule) this._ssrModule[prop] = value$1;
|
27814
27852
|
}
|
27815
27853
|
_wrapModuleSet(prop, module$1) {
|
27816
|
-
if (!module$1) return new Set();
|
27854
|
+
if (!module$1) return /* @__PURE__ */ new Set();
|
27817
27855
|
return createBackwardCompatibleModuleSet(this._moduleGraph, prop, module$1);
|
27818
27856
|
}
|
27819
27857
|
_getModuleSetUnion(prop) {
|
27820
|
-
const importedModules = new Set();
|
27821
|
-
const ids = new Set();
|
27858
|
+
const importedModules = /* @__PURE__ */ new Set();
|
27859
|
+
const ids = /* @__PURE__ */ new Set();
|
27822
27860
|
if (this._clientModule) for (const mod of this._clientModule[prop]) {
|
27823
27861
|
if (mod.id) ids.add(mod.id);
|
27824
27862
|
importedModules.add(this._moduleGraph.getBackwardCompatibleModuleNode(mod));
|
@@ -27995,7 +28033,7 @@ var ModuleGraph = class {
|
|
27995
28033
|
const clientModules = this._client.getModulesByFile(file);
|
27996
28034
|
const ssrModules = this._ssr.getModulesByFile(file);
|
27997
28035
|
if (!clientModules && !ssrModules) return void 0;
|
27998
|
-
const result = new Set();
|
28036
|
+
const result = /* @__PURE__ */ new Set();
|
27999
28037
|
if (clientModules) for (const mod of clientModules) result.add(this.getBackwardCompatibleBrowserModuleNode(mod));
|
28000
28038
|
if (ssrModules) {
|
28001
28039
|
for (const mod of ssrModules) if (mod.id == null || !this._client.getModuleById(mod.id)) result.add(this.getBackwardCompatibleServerModuleNode(mod));
|
@@ -28018,7 +28056,7 @@ var ModuleGraph = class {
|
|
28018
28056
|
default: throw new Error(`Invalid module node environment ${environment}`);
|
28019
28057
|
}
|
28020
28058
|
}
|
28021
|
-
invalidateModule(mod, seen$1 = new Set(), timestamp =
|
28059
|
+
invalidateModule(mod, seen$1 = /* @__PURE__ */ new Set(), timestamp = monotonicDateNow(), isHmr = false, softInvalidate = false) {
|
28022
28060
|
if (mod._clientModule) this._client.invalidateModule(mod._clientModule, new Set([...seen$1].map((mod$1) => mod$1._clientModule).filter(Boolean)), timestamp, isHmr, softInvalidate);
|
28023
28061
|
if (mod._ssrModule) this._ssr.invalidateModule(mod._ssrModule, new Set([...seen$1].map((mod$1) => mod$1._ssrModule).filter(Boolean)), timestamp, isHmr, softInvalidate);
|
28024
28062
|
}
|
@@ -28064,7 +28102,7 @@ var ModuleGraph = class {
|
|
28064
28102
|
}
|
28065
28103
|
};
|
28066
28104
|
var DualWeakMap = class {
|
28067
|
-
map = new WeakMap();
|
28105
|
+
map = /* @__PURE__ */ new WeakMap();
|
28068
28106
|
undefinedKey = {};
|
28069
28107
|
get(key1, key2) {
|
28070
28108
|
const k1 = key1 ?? this.undefinedKey;
|
@@ -28074,7 +28112,7 @@ var DualWeakMap = class {
|
|
28074
28112
|
set(key1, key2, value$1) {
|
28075
28113
|
const k1 = key1 ?? this.undefinedKey;
|
28076
28114
|
const k2 = key2 ?? this.undefinedKey;
|
28077
|
-
if (!this.map.has(k1)) this.map.set(k1, new Map());
|
28115
|
+
if (!this.map.has(k1)) this.map.set(k1, /* @__PURE__ */ new Map());
|
28078
28116
|
const m$2 = this.map.get(k1);
|
28079
28117
|
m$2.set(k2, value$1);
|
28080
28118
|
}
|
@@ -28170,7 +28208,7 @@ function createBackwardCompatibleFileToModulesMap(moduleGraph) {
|
|
28170
28208
|
const clientModules = moduleGraph._client.fileToModulesMap.get(key);
|
28171
28209
|
const ssrModules = moduleGraph._ssr.fileToModulesMap.get(key);
|
28172
28210
|
if (!clientModules && !ssrModules) return;
|
28173
|
-
const modules = clientModules ?? new Set();
|
28211
|
+
const modules = clientModules ?? /* @__PURE__ */ new Set();
|
28174
28212
|
if (ssrModules) {
|
28175
28213
|
for (const ssrModule of ssrModules) if (ssrModule.id) {
|
28176
28214
|
let found$1 = false;
|
@@ -28296,7 +28334,7 @@ var import_lib$1 = __toESM(require_lib(), 1);
|
|
28296
28334
|
var import_picocolors$10 = __toESM(require_picocolors(), 1);
|
28297
28335
|
var import_chokidar = __toESM(require_chokidar(), 1);
|
28298
28336
|
var import_launch_editor_middleware = __toESM(require_launch_editor_middleware(), 1);
|
28299
|
-
const usedConfigs = new WeakSet();
|
28337
|
+
const usedConfigs = /* @__PURE__ */ new WeakSet();
|
28300
28338
|
function createServer$2(inlineConfig = {}) {
|
28301
28339
|
return _createServer(inlineConfig, { listen: true });
|
28302
28340
|
}
|
@@ -28322,7 +28360,7 @@ async function _createServer(inlineConfig = {}, options$1) {
|
|
28322
28360
|
const { publicDir } = config$2;
|
28323
28361
|
if (httpServer) setClientErrorHandler(httpServer, config$2.logger);
|
28324
28362
|
const watchEnabled = serverConfig.watch !== null;
|
28325
|
-
const watcher = watchEnabled ? import_chokidar.
|
28363
|
+
const watcher = watchEnabled ? import_chokidar.watch([
|
28326
28364
|
root,
|
28327
28365
|
...config$2.configFileDependencies,
|
28328
28366
|
...getEnvFilesForMode(config$2.mode, config$2.envDir),
|
@@ -28410,7 +28448,7 @@ async function _createServer(inlineConfig = {}, options$1) {
|
|
28410
28448
|
async reloadModule(module$1) {
|
28411
28449
|
if (serverConfig.hmr !== false && module$1.file) {
|
28412
28450
|
const environmentModule = module$1._clientModule ?? module$1._ssrModule;
|
28413
|
-
updateModules(environments[environmentModule.environment], module$1.file, [environmentModule],
|
28451
|
+
updateModules(environments[environmentModule.environment], module$1.file, [environmentModule], monotonicDateNow());
|
28414
28452
|
}
|
28415
28453
|
},
|
28416
28454
|
async listen(port, isRestart) {
|
@@ -28489,7 +28527,7 @@ async function _createServer(inlineConfig = {}, options$1) {
|
|
28489
28527
|
if (serverConfig.hmr !== false) await handleHMRUpdate(type, file, server);
|
28490
28528
|
};
|
28491
28529
|
const onFileAddUnlink = async (file, isUnlink) => {
|
28492
|
-
file = normalizePath
|
28530
|
+
file = normalizePath(file);
|
28493
28531
|
reloadOnTsconfigChange(server, file);
|
28494
28532
|
await pluginContainer.watchChange(file, { event: isUnlink ? "delete" : "create" });
|
28495
28533
|
if (publicDir && publicFiles) {
|
@@ -28508,7 +28546,7 @@ async function _createServer(inlineConfig = {}, options$1) {
|
|
28508
28546
|
await onHMRUpdate(isUnlink ? "delete" : "create", file);
|
28509
28547
|
};
|
28510
28548
|
watcher.on("change", async (file) => {
|
28511
|
-
file = normalizePath
|
28549
|
+
file = normalizePath(file);
|
28512
28550
|
reloadOnTsconfigChange(server, file);
|
28513
28551
|
await pluginContainer.watchChange(file, { event: "update" });
|
28514
28552
|
for (const environment of Object.values(server.environments)) environment.moduleGraph.onFileChange(file);
|
@@ -28523,22 +28561,22 @@ async function _createServer(inlineConfig = {}, options$1) {
|
|
28523
28561
|
if (!middlewareMode && httpServer) httpServer.once("listening", () => {
|
28524
28562
|
serverConfig.port = httpServer.address().port;
|
28525
28563
|
});
|
28526
|
-
const configureServerContext = new BasicMinimalPluginContext({
|
28527
|
-
...basePluginContextMeta,
|
28528
|
-
watchMode: true
|
28529
|
-
}, config$2.logger);
|
28530
|
-
const postHooks = [];
|
28531
|
-
for (const hook of config$2.getSortedPluginHooks("configureServer")) postHooks.push(await hook.call(configureServerContext, reflexServer));
|
28532
28564
|
if (process.env.DEBUG) middlewares.use(timeMiddleware(root));
|
28533
28565
|
middlewares.use(rejectInvalidRequestMiddleware());
|
28534
28566
|
const { cors } = serverConfig;
|
28535
28567
|
if (cors !== false) middlewares.use((0, import_lib$1.default)(typeof cors === "boolean" ? {} : cors));
|
28536
28568
|
const { allowedHosts } = serverConfig;
|
28537
28569
|
if (allowedHosts !== true && !serverConfig.https) middlewares.use(hostValidationMiddleware(allowedHosts, false));
|
28570
|
+
const configureServerContext = new BasicMinimalPluginContext({
|
28571
|
+
...basePluginContextMeta,
|
28572
|
+
watchMode: true
|
28573
|
+
}, config$2.logger);
|
28574
|
+
const postHooks = [];
|
28575
|
+
for (const hook of config$2.getSortedPluginHooks("configureServer")) postHooks.push(await hook.call(configureServerContext, reflexServer));
|
28538
28576
|
middlewares.use(cachedTransformMiddleware(server));
|
28539
28577
|
const { proxy } = serverConfig;
|
28540
28578
|
if (proxy) {
|
28541
|
-
const middlewareServer = (isObject
|
28579
|
+
const middlewareServer = (isObject(middlewareMode) ? middlewareMode.server : null) || httpServer;
|
28542
28580
|
middlewares.use(proxyMiddleware(middlewareServer, proxy, config$2));
|
28543
28581
|
}
|
28544
28582
|
if (config$2.base !== "/") middlewares.use(baseMiddleware(config$2.rawBase, !!middlewareMode));
|
@@ -28604,7 +28642,7 @@ async function startServer(server, inlinePort) {
|
|
28604
28642
|
function createServerCloseFn(server) {
|
28605
28643
|
if (!server) return () => Promise.resolve();
|
28606
28644
|
let hasListened = false;
|
28607
|
-
const openSockets = new Set();
|
28645
|
+
const openSockets = /* @__PURE__ */ new Set();
|
28608
28646
|
server.on("connection", (socket) => {
|
28609
28647
|
openSockets.add(socket);
|
28610
28648
|
socket.on("close", () => {
|
@@ -28624,7 +28662,7 @@ function createServerCloseFn(server) {
|
|
28624
28662
|
});
|
28625
28663
|
}
|
28626
28664
|
function resolvedAllowDir(root, dir) {
|
28627
|
-
return normalizePath
|
28665
|
+
return normalizePath(path.resolve(root, dir));
|
28628
28666
|
}
|
28629
28667
|
const serverConfigDefaults = Object.freeze({
|
28630
28668
|
port: DEFAULT_DEV_PORT,
|
@@ -28657,7 +28695,7 @@ function resolveServerOptions(root, raw, logger) {
|
|
28657
28695
|
const _server = mergeWithDefaults({
|
28658
28696
|
...serverConfigDefaults,
|
28659
28697
|
host: void 0,
|
28660
|
-
sourcemapIgnoreList: isInNodeModules
|
28698
|
+
sourcemapIgnoreList: isInNodeModules
|
28661
28699
|
}, raw ?? {});
|
28662
28700
|
const server = {
|
28663
28701
|
..._server,
|
@@ -28750,13 +28788,13 @@ async function restartServerWithUrls(server) {
|
|
28750
28788
|
var import_picocolors$9 = __toESM(require_picocolors(), 1);
|
28751
28789
|
const debugHmr = createDebugger("vite:hmr");
|
28752
28790
|
const whitespaceRE = /\s/;
|
28753
|
-
const normalizedClientDir = normalizePath
|
28791
|
+
const normalizedClientDir = normalizePath(CLIENT_DIR);
|
28754
28792
|
function getShortName(file, root) {
|
28755
28793
|
return file.startsWith(withTrailingSlash(root)) ? path.posix.relative(root, file) : file;
|
28756
28794
|
}
|
28757
28795
|
const normalizeHotChannel = (channel, enableHmr, normalizeClient = true) => {
|
28758
|
-
const normalizedListenerMap = new WeakMap();
|
28759
|
-
const listenersForEvents = new Map();
|
28796
|
+
const normalizedListenerMap = /* @__PURE__ */ new WeakMap();
|
28797
|
+
const listenersForEvents = /* @__PURE__ */ new Map();
|
28760
28798
|
let invokeHandlers;
|
28761
28799
|
let listenerForInvokeHandler;
|
28762
28800
|
const handleInvoke = async (payload) => {
|
@@ -28802,7 +28840,7 @@ const normalizeHotChannel = (channel, enableHmr, normalizeClient = true) => {
|
|
28802
28840
|
};
|
28803
28841
|
normalizedListenerMap.set(fn, listenerWithNormalizedClient);
|
28804
28842
|
channel.on?.(event, listenerWithNormalizedClient);
|
28805
|
-
if (!listenersForEvents.has(event)) listenersForEvents.set(event, new Set());
|
28843
|
+
if (!listenersForEvents.has(event)) listenersForEvents.set(event, /* @__PURE__ */ new Set());
|
28806
28844
|
listenersForEvents.get(event).add(listenerWithNormalizedClient);
|
28807
28845
|
},
|
28808
28846
|
off: (event, fn) => {
|
@@ -28880,7 +28918,7 @@ function getSortedPluginsByHotUpdateHook(plugins$1) {
|
|
28880
28918
|
}
|
28881
28919
|
return sortedPlugins;
|
28882
28920
|
}
|
28883
|
-
const sortedHotUpdatePluginsCache = new WeakMap();
|
28921
|
+
const sortedHotUpdatePluginsCache = /* @__PURE__ */ new WeakMap();
|
28884
28922
|
function getSortedHotUpdatePlugins(environment) {
|
28885
28923
|
let sortedPlugins = sortedHotUpdatePluginsCache.get(environment);
|
28886
28924
|
if (!sortedPlugins) {
|
@@ -28899,7 +28937,7 @@ async function handleHMRUpdate(type, file, server) {
|
|
28899
28937
|
const isEnv = config$2.envDir !== false && getEnvFilesForMode(config$2.mode, config$2.envDir).includes(file);
|
28900
28938
|
if (isConfig || isConfigDependency || isEnv) {
|
28901
28939
|
debugHmr?.(`[config change] ${import_picocolors$9.default.dim(shortFile)}`);
|
28902
|
-
config$2.logger.info(import_picocolors$9.default.green(`${normalizePath
|
28940
|
+
config$2.logger.info(import_picocolors$9.default.green(`${normalizePath(path.relative(process.cwd(), file))} changed, restarting server...`), {
|
28903
28941
|
clear: true,
|
28904
28942
|
timestamp: true
|
28905
28943
|
});
|
@@ -28919,7 +28957,7 @@ async function handleHMRUpdate(type, file, server) {
|
|
28919
28957
|
}));
|
28920
28958
|
return;
|
28921
28959
|
}
|
28922
|
-
const timestamp =
|
28960
|
+
const timestamp = monotonicDateNow();
|
28923
28961
|
const contextMeta = {
|
28924
28962
|
type,
|
28925
28963
|
file,
|
@@ -28927,7 +28965,7 @@ async function handleHMRUpdate(type, file, server) {
|
|
28927
28965
|
read: () => readModifiedFile(file),
|
28928
28966
|
server
|
28929
28967
|
};
|
28930
|
-
const hotMap = new Map();
|
28968
|
+
const hotMap = /* @__PURE__ */ new Map();
|
28931
28969
|
for (const environment of Object.values(server.environments)) {
|
28932
28970
|
const mods = new Set(environment.moduleGraph.getModulesByFile(file));
|
28933
28971
|
if (type === "create") for (const mod of environment.moduleGraph._hasResolveFailedErrorModules) mods.add(mod);
|
@@ -29000,7 +29038,7 @@ async function handleHMRUpdate(type, file, server) {
|
|
29000
29038
|
});
|
29001
29039
|
environment.hot.send({
|
29002
29040
|
type: "full-reload",
|
29003
|
-
path: config$2.server.middlewareMode ? "*" : "/" + normalizePath
|
29041
|
+
path: config$2.server.middlewareMode ? "*" : "/" + normalizePath(path.relative(config$2.root, file))
|
29004
29042
|
});
|
29005
29043
|
} else debugHmr?.(`(${environment.name}) [no modules matched] ${import_picocolors$9.default.dim(shortFile)}`);
|
29006
29044
|
return;
|
@@ -29021,8 +29059,8 @@ async function handleHMRUpdate(type, file, server) {
|
|
29021
29059
|
function updateModules(environment, file, modules, timestamp, firstInvalidatedBy) {
|
29022
29060
|
const { hot } = environment;
|
29023
29061
|
const updates = [];
|
29024
|
-
const invalidatedModules = new Set();
|
29025
|
-
const traversedModules = new Set();
|
29062
|
+
const invalidatedModules = /* @__PURE__ */ new Set();
|
29063
|
+
const traversedModules = /* @__PURE__ */ new Set();
|
29026
29064
|
let needFullReload = modules.length === 0;
|
29027
29065
|
for (const mod of modules) {
|
29028
29066
|
const boundaries = [];
|
@@ -29129,7 +29167,7 @@ function propagateUpdate(node, traversedModules, boundaries, currentChain = [nod
|
|
29129
29167
|
* @param currentChain The current chain tracked from the `node` parameter
|
29130
29168
|
* @param traversedModules The set of modules that have traversed
|
29131
29169
|
*/
|
29132
|
-
function isNodeWithinCircularImports(node, nodeChain, currentChain = [node], traversedModules = new Set()) {
|
29170
|
+
function isNodeWithinCircularImports(node, nodeChain, currentChain = [node], traversedModules = /* @__PURE__ */ new Set()) {
|
29133
29171
|
if (traversedModules.has(node)) return false;
|
29134
29172
|
traversedModules.add(node);
|
29135
29173
|
for (const importer of node.importers) {
|
@@ -29155,7 +29193,7 @@ function isNodeWithinCircularImports(node, nodeChain, currentChain = [node], tra
|
|
29155
29193
|
return false;
|
29156
29194
|
}
|
29157
29195
|
function handlePrunedModules(mods, { hot }) {
|
29158
|
-
const t$1 =
|
29196
|
+
const t$1 = monotonicDateNow();
|
29159
29197
|
mods.forEach((mod) => {
|
29160
29198
|
mod.lastHMRTimestamp = t$1;
|
29161
29199
|
mod.lastHMRInvalidationReceived = false;
|
@@ -29242,13 +29280,13 @@ function lexAcceptedHmrDeps(code, start, urls) {
|
|
29242
29280
|
return false;
|
29243
29281
|
}
|
29244
29282
|
function lexAcceptedHmrExports(code, start, exportNames) {
|
29245
|
-
const urls = new Set();
|
29283
|
+
const urls = /* @__PURE__ */ new Set();
|
29246
29284
|
lexAcceptedHmrDeps(code, start, urls);
|
29247
29285
|
for (const { url: url$6 } of urls) exportNames.add(url$6);
|
29248
29286
|
return urls.size > 0;
|
29249
29287
|
}
|
29250
29288
|
function normalizeHmrUrl(url$6) {
|
29251
|
-
if (url$6[0] !== "." && url$6[0] !== "/") url$6 = wrapId
|
29289
|
+
if (url$6[0] !== "." && url$6[0] !== "/") url$6 = wrapId(url$6);
|
29252
29290
|
return url$6;
|
29253
29291
|
}
|
29254
29292
|
function error(pos) {
|
@@ -29300,7 +29338,7 @@ function createServerHotChannel() {
|
|
29300
29338
|
const nonJsRe = /\.json(?:$|\?)/;
|
29301
29339
|
const isNonJsRequest = (request) => nonJsRe.test(request);
|
29302
29340
|
const importMetaEnvMarker = "__vite_import_meta_env__";
|
29303
|
-
const importMetaEnvKeyReCache = new Map();
|
29341
|
+
const importMetaEnvKeyReCache = /* @__PURE__ */ new Map();
|
29304
29342
|
function definePlugin(config$2) {
|
29305
29343
|
const isBuild = config$2.command === "build";
|
29306
29344
|
const isBuildLib = isBuild && config$2.build.lib;
|
@@ -29361,7 +29399,7 @@ function definePlugin(config$2) {
|
|
29361
29399
|
importMetaEnvVal
|
29362
29400
|
];
|
29363
29401
|
}
|
29364
|
-
const patternsCache = new WeakMap();
|
29402
|
+
const patternsCache = /* @__PURE__ */ new WeakMap();
|
29365
29403
|
function getPattern(environment) {
|
29366
29404
|
let pattern = patternsCache.get(environment);
|
29367
29405
|
if (!pattern) {
|
@@ -29473,7 +29511,7 @@ const workerOrSharedWorkerRE = /(?:\?|&)(worker|sharedworker)(?:&|$)/;
|
|
29473
29511
|
const workerFileRE = /(?:\?|&)worker_file&type=(\w+)(?:&|$)/;
|
29474
29512
|
const inlineRE$1 = /[?&]inline\b/;
|
29475
29513
|
const WORKER_FILE_ID = "worker_file";
|
29476
|
-
const workerCache = new WeakMap();
|
29514
|
+
const workerCache = /* @__PURE__ */ new WeakMap();
|
29477
29515
|
function saveEmitWorkerAsset(config$2, asset) {
|
29478
29516
|
const workerMap = workerCache.get(config$2.mainConfig || config$2);
|
29479
29517
|
const duplicateAsset = workerMap.assets.get(asset.fileName);
|
@@ -29591,42 +29629,12 @@ function webWorkerPlugin(config$2) {
|
|
29591
29629
|
buildStart() {
|
29592
29630
|
if (isWorker) return;
|
29593
29631
|
workerCache.set(config$2, {
|
29594
|
-
assets: new Map(),
|
29595
|
-
bundle: new Map(),
|
29596
|
-
fileNameHash: new Map()
|
29632
|
+
assets: /* @__PURE__ */ new Map(),
|
29633
|
+
bundle: /* @__PURE__ */ new Map(),
|
29634
|
+
fileNameHash: /* @__PURE__ */ new Map()
|
29597
29635
|
});
|
29598
29636
|
},
|
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
|
-
}
|
29637
|
+
load: { async handler(id) {
|
29630
29638
|
const workerMatch = workerOrSharedWorkerRE.exec(id);
|
29631
29639
|
if (!workerMatch) return;
|
29632
29640
|
const { format: format$3 } = config$2.worker;
|
@@ -29679,7 +29687,7 @@ function webWorkerPlugin(config$2) {
|
|
29679
29687
|
url$6 = injectQuery(url$6, `${WORKER_FILE_ID}&type=${workerType}`);
|
29680
29688
|
urlCode = JSON.stringify(url$6);
|
29681
29689
|
}
|
29682
|
-
if (urlRE
|
29690
|
+
if (urlRE.test(id)) return {
|
29683
29691
|
code: `export default ${urlCode}`,
|
29684
29692
|
map: { mappings: "" }
|
29685
29693
|
};
|
@@ -29693,6 +29701,34 @@ function webWorkerPlugin(config$2) {
|
|
29693
29701
|
map: { mappings: "" }
|
29694
29702
|
};
|
29695
29703
|
} },
|
29704
|
+
shouldTransformCachedModule({ id }) {
|
29705
|
+
if (isBuild && config$2.build.watch && workerOrSharedWorkerRE.test(id)) return true;
|
29706
|
+
},
|
29707
|
+
transform: { async handler(raw, id) {
|
29708
|
+
const workerFileMatch = workerFileRE.exec(id);
|
29709
|
+
if (workerFileMatch) {
|
29710
|
+
const workerType = workerFileMatch[1];
|
29711
|
+
let injectEnv = "";
|
29712
|
+
const scriptPath = JSON.stringify(path.posix.join(config$2.base, ENV_PUBLIC_PATH));
|
29713
|
+
if (workerType === "classic") injectEnv = `importScripts(${scriptPath})\n`;
|
29714
|
+
else if (workerType === "module") injectEnv = `import ${scriptPath}\n`;
|
29715
|
+
else if (workerType === "ignore") if (isBuild) injectEnv = "";
|
29716
|
+
else {
|
29717
|
+
const environment = this.environment;
|
29718
|
+
const moduleGraph = environment.mode === "dev" ? environment.moduleGraph : void 0;
|
29719
|
+
const module$1 = moduleGraph?.getModuleById(ENV_ENTRY);
|
29720
|
+
injectEnv = module$1?.transformResult?.code || "";
|
29721
|
+
}
|
29722
|
+
if (injectEnv) {
|
29723
|
+
const s$2 = new MagicString(raw);
|
29724
|
+
s$2.prepend(injectEnv + ";\n");
|
29725
|
+
return {
|
29726
|
+
code: s$2.toString(),
|
29727
|
+
map: s$2.generateMap({ hires: "boundary" })
|
29728
|
+
};
|
29729
|
+
}
|
29730
|
+
}
|
29731
|
+
} },
|
29696
29732
|
renderChunk(code, chunk, outputOptions) {
|
29697
29733
|
let s$2;
|
29698
29734
|
const result = () => {
|
@@ -29772,7 +29808,7 @@ function preAliasPlugin(config$2) {
|
|
29772
29808
|
const optimizeDeps$1 = depsOptimizer.options;
|
29773
29809
|
const resolvedId = cleanUrl(resolved.id);
|
29774
29810
|
const isVirtual = resolvedId === id || resolvedId.includes("\0");
|
29775
|
-
if (!isVirtual && fs.existsSync(resolvedId) && !moduleListContains(optimizeDeps$1.exclude, id) && path.isAbsolute(resolvedId) && (isInNodeModules
|
29811
|
+
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
29812
|
const optimizedInfo = depsOptimizer.registerMissingImport(id, resolvedId);
|
29777
29813
|
return { id: depsOptimizer.getOptimizedDepId(optimizedInfo) };
|
29778
29814
|
}
|
@@ -29806,7 +29842,7 @@ function getAliasPatternMatcher(entries) {
|
|
29806
29842
|
//#region src/node/plugins/importAnalysis.ts
|
29807
29843
|
var import_picocolors$7 = __toESM(require_picocolors(), 1);
|
29808
29844
|
const debug$2 = createDebugger("vite:import-analysis");
|
29809
|
-
const clientDir = normalizePath
|
29845
|
+
const clientDir = normalizePath(CLIENT_DIR);
|
29810
29846
|
const skipRE = /\.(?:map|json)(?:$|\?)/;
|
29811
29847
|
const canSkipImportAnalysis = (id) => skipRE.test(id) || isDirectCSSRequest(id);
|
29812
29848
|
const optimizedDepChunkRE = /\/chunk-[A-Z\d]{8}\.js/;
|
@@ -29823,13 +29859,13 @@ function normalizeResolvedIdToUrl(environment, url$6, resolved) {
|
|
29823
29859
|
if (resolved.id.startsWith(withTrailingSlash(root))) url$6 = resolved.id.slice(root.length);
|
29824
29860
|
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
29861
|
else url$6 = resolved.id;
|
29826
|
-
if (url$6[0] !== "." && url$6[0] !== "/") url$6 = wrapId
|
29862
|
+
if (url$6[0] !== "." && url$6[0] !== "/") url$6 = wrapId(resolved.id);
|
29827
29863
|
return url$6;
|
29828
29864
|
}
|
29829
29865
|
function extractImportedBindings(id, source, importSpec, importedBindings) {
|
29830
29866
|
let bindings = importedBindings.get(id);
|
29831
29867
|
if (!bindings) {
|
29832
|
-
bindings = new Set();
|
29868
|
+
bindings = /* @__PURE__ */ new Set();
|
29833
29869
|
importedBindings.set(id, bindings);
|
29834
29870
|
}
|
29835
29871
|
const isDynamic = importSpec.d > -1;
|
@@ -29918,12 +29954,12 @@ function importAnalysisPlugin(config$2) {
|
|
29918
29954
|
return null;
|
29919
29955
|
}
|
29920
29956
|
const msAtStart = debug$2 ? performance$1.now() : 0;
|
29921
|
-
await init
|
29957
|
+
await init;
|
29922
29958
|
let imports;
|
29923
29959
|
let exports$1;
|
29924
29960
|
source = stripBomTag(source);
|
29925
29961
|
try {
|
29926
|
-
[imports, exports$1] = parse
|
29962
|
+
[imports, exports$1] = parse(source);
|
29927
29963
|
} catch (_e) {
|
29928
29964
|
const e$1 = _e;
|
29929
29965
|
const { message, showCodeFrame } = createParseErrorInfo(importer, source);
|
@@ -29944,7 +29980,7 @@ function importAnalysisPlugin(config$2) {
|
|
29944
29980
|
let s$2;
|
29945
29981
|
const str = () => s$2 || (s$2 = new MagicString(source));
|
29946
29982
|
let isPartiallySelfAccepting = false;
|
29947
|
-
const importedBindings = enablePartialAccept ? new Map() : null;
|
29983
|
+
const importedBindings = enablePartialAccept ? /* @__PURE__ */ new Map() : null;
|
29948
29984
|
const toAbsoluteUrl = (url$6) => path.posix.resolve(path.posix.dirname(importerModule.url), url$6);
|
29949
29985
|
const normalizeUrl = async (url$6, pos, forceSkipImportAnalysis = false) => {
|
29950
29986
|
url$6 = stripBase(url$6, base);
|
@@ -29964,7 +30000,7 @@ function importAnalysisPlugin(config$2) {
|
|
29964
30000
|
if (ssr) return [url$6, null];
|
29965
30001
|
importerModule.isSelfAccepting = false;
|
29966
30002
|
moduleGraph._hasResolveFailedErrorModules.add(importerModule);
|
29967
|
-
return this.error(`Failed to resolve import "${url$6}" from "${normalizePath
|
30003
|
+
return this.error(`Failed to resolve import "${url$6}" from "${normalizePath(path.relative(process.cwd(), importerFile))}". Does the file exist?`, pos);
|
29968
30004
|
}
|
29969
30005
|
if (isExternalUrl(resolved.id)) return [resolved.id, resolved.id];
|
29970
30006
|
const isRelative$1 = url$6[0] === ".";
|
@@ -29978,7 +30014,7 @@ function importAnalysisPlugin(config$2) {
|
|
29978
30014
|
}
|
29979
30015
|
}
|
29980
30016
|
try {
|
29981
|
-
const depModule = await moduleGraph._ensureEntryFromUrl(unwrapId
|
30017
|
+
const depModule = await moduleGraph._ensureEntryFromUrl(unwrapId(url$6), canSkipImportAnalysis(url$6) || forceSkipImportAnalysis, resolved);
|
29982
30018
|
if (environment.config.consumer === "client" && depModule.lastHMRTimestamp > 0) url$6 = injectQuery(url$6, `t=${depModule.lastHMRTimestamp}`);
|
29983
30019
|
} catch (e$1) {
|
29984
30020
|
e$1.pos = pos;
|
@@ -30000,11 +30036,11 @@ function importAnalysisPlugin(config$2) {
|
|
30000
30036
|
hasHMR = true;
|
30001
30037
|
const endHot = end + 4 + (source[end + 4] === "?" ? 1 : 0);
|
30002
30038
|
if (source.slice(endHot, endHot + 7) === ".accept") if (source.slice(endHot, endHot + 14) === ".acceptExports") {
|
30003
|
-
const importAcceptedExports = orderedAcceptedExports[index] = new Set();
|
30039
|
+
const importAcceptedExports = orderedAcceptedExports[index] = /* @__PURE__ */ new Set();
|
30004
30040
|
lexAcceptedHmrExports(source, source.indexOf("(", endHot + 14) + 1, importAcceptedExports);
|
30005
30041
|
isPartiallySelfAccepting = true;
|
30006
30042
|
} else {
|
30007
|
-
const importAcceptedUrls = orderedAcceptedUrls[index] = new Set();
|
30043
|
+
const importAcceptedUrls = orderedAcceptedUrls[index] = /* @__PURE__ */ new Set();
|
30008
30044
|
if (lexAcceptedHmrDeps(source, source.indexOf("(", endHot + 7) + 1, importAcceptedUrls)) isSelfAccepting = true;
|
30009
30045
|
}
|
30010
30046
|
} else if (prop === ".env") hasEnv = true;
|
@@ -30021,7 +30057,7 @@ function importAnalysisPlugin(config$2) {
|
|
30021
30057
|
if (isBuiltin(environment.config.resolve.builtins, specifier)) return;
|
30022
30058
|
}
|
30023
30059
|
if (specifier === clientPublicPath) return;
|
30024
|
-
if (specifier[0] === "/" && !(config$2.assetsInclude(cleanUrl(specifier)) || urlRE
|
30060
|
+
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
30061
|
let [url$6, resolvedId] = await normalizeUrl(specifier, start);
|
30026
30062
|
resolvedId = resolvedId || url$6;
|
30027
30063
|
config$2.safeModulePaths.add(fsPathFromUrl(stripBase(url$6, base)));
|
@@ -30048,7 +30084,7 @@ function importAnalysisPlugin(config$2) {
|
|
30048
30084
|
str().overwrite(s$3, e$1, rewrittenUrl, { contentOnly: true });
|
30049
30085
|
}
|
30050
30086
|
}
|
30051
|
-
const hmrUrl = unwrapId
|
30087
|
+
const hmrUrl = unwrapId(stripBase(url$6, base));
|
30052
30088
|
const isLocalImport = !isExternalUrl(hmrUrl) && !isDataUrl(hmrUrl);
|
30053
30089
|
if (isLocalImport) orderedImportedUrls[index] = hmrUrl;
|
30054
30090
|
if (enablePartialAccept && importedBindings) extractImportedBindings(resolvedId, source, importSpecifier, importedBindings);
|
@@ -30057,7 +30093,7 @@ function importAnalysisPlugin(config$2) {
|
|
30057
30093
|
environment.warmupRequest(url$7);
|
30058
30094
|
}
|
30059
30095
|
} else if (!importer.startsWith(withTrailingSlash(clientDir))) {
|
30060
|
-
if (!isInNodeModules
|
30096
|
+
if (!isInNodeModules(importer)) {
|
30061
30097
|
const hasViteIgnore = hasViteIgnoreRE.test(source.slice(dynamicIndex + 1, end));
|
30062
30098
|
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
30099
|
}
|
@@ -30082,7 +30118,7 @@ function importAnalysisPlugin(config$2) {
|
|
30082
30118
|
}
|
30083
30119
|
if (needQueryInjectHelper) if (isClassicWorker) str().append("\n" + __vite__injectQuery.toString());
|
30084
30120
|
else str().prepend(`import { injectQuery as __vite__injectQuery } from "${clientPublicPath}";`);
|
30085
|
-
const normalizedAcceptedUrls = new Set();
|
30121
|
+
const normalizedAcceptedUrls = /* @__PURE__ */ new Set();
|
30086
30122
|
for (const { url: url$6, start, end } of acceptedUrls) {
|
30087
30123
|
let [normalized, resolvedId] = await normalizeUrl(url$6, start).catch(() => []);
|
30088
30124
|
if (resolvedId) {
|
@@ -30122,7 +30158,7 @@ function importAnalysisPlugin(config$2) {
|
|
30122
30158
|
};
|
30123
30159
|
}
|
30124
30160
|
function mergeAcceptedUrls(orderedUrls) {
|
30125
|
-
const acceptedUrls = new Set();
|
30161
|
+
const acceptedUrls = /* @__PURE__ */ new Set();
|
30126
30162
|
for (const urls of orderedUrls) {
|
30127
30163
|
if (!urls) continue;
|
30128
30164
|
for (const url$6 of urls) acceptedUrls.add(url$6);
|
@@ -30237,8 +30273,8 @@ function __vite__injectQuery(url$6, queryToInject) {
|
|
30237
30273
|
|
30238
30274
|
//#endregion
|
30239
30275
|
//#region src/node/plugins/clientInjections.ts
|
30240
|
-
const normalizedClientEntry = normalizePath
|
30241
|
-
const normalizedEnvEntry = normalizePath
|
30276
|
+
const normalizedClientEntry = normalizePath(CLIENT_ENTRY);
|
30277
|
+
const normalizedEnvEntry = normalizePath(ENV_ENTRY);
|
30242
30278
|
/**
|
30243
30279
|
* some values used by the client needs to be dynamically injected by the server
|
30244
30280
|
* @server-only
|
@@ -30260,7 +30296,7 @@ function clientInjectionsPlugin(config$2) {
|
|
30260
30296
|
const devBase = config$2.base;
|
30261
30297
|
const serverHost = `${resolvedServerHostname}:${resolvedServerPort}${devBase}`;
|
30262
30298
|
let hmrConfig = config$2.server.hmr;
|
30263
|
-
hmrConfig = isObject
|
30299
|
+
hmrConfig = isObject(hmrConfig) ? hmrConfig : void 0;
|
30264
30300
|
const host = hmrConfig?.host || null;
|
30265
30301
|
const protocol = hmrConfig?.protocol || null;
|
30266
30302
|
const timeout = hmrConfig?.timeout || 3e4;
|
@@ -30472,7 +30508,7 @@ function workerImportMetaUrlPlugin(config$2) {
|
|
30472
30508
|
let file;
|
30473
30509
|
if (url$6[0] === ".") {
|
30474
30510
|
file = path.resolve(path.dirname(id), url$6);
|
30475
|
-
file = slash
|
30511
|
+
file = slash(tryFsResolve(file, fsResolveOptions) ?? file);
|
30476
30512
|
} else {
|
30477
30513
|
workerResolver ??= createBackCompatIdResolver(config$2, {
|
30478
30514
|
extensions: [],
|
@@ -30480,7 +30516,7 @@ function workerImportMetaUrlPlugin(config$2) {
|
|
30480
30516
|
preferRelative: true
|
30481
30517
|
});
|
30482
30518
|
file = await workerResolver(this.environment, url$6, id);
|
30483
|
-
file ??= url$6[0] === "/" ? slash
|
30519
|
+
file ??= url$6[0] === "/" ? slash(path.join(config$2.publicDir, url$6)) : slash(path.resolve(path.dirname(id), url$6));
|
30484
30520
|
}
|
30485
30521
|
if (isBuild && config$2.isWorker && config$2.bundleChain.at(-1) === cleanUrl(file)) s$2.update(expStart, expEnd, "self.location.href");
|
30486
30522
|
else {
|
@@ -30562,7 +30598,7 @@ function assetImportMetaUrlPlugin(config$2) {
|
|
30562
30598
|
if (isDataUrl(url$6)) continue;
|
30563
30599
|
let file;
|
30564
30600
|
if (url$6[0] === ".") {
|
30565
|
-
file = slash
|
30601
|
+
file = slash(path.resolve(path.dirname(id), url$6));
|
30566
30602
|
file = tryFsResolve(file, fsResolveOptions) ?? file;
|
30567
30603
|
} else {
|
30568
30604
|
assetResolver ??= createBackCompatIdResolver(config$2, {
|
@@ -30572,7 +30608,7 @@ function assetImportMetaUrlPlugin(config$2) {
|
|
30572
30608
|
preferRelative: true
|
30573
30609
|
});
|
30574
30610
|
file = await assetResolver(this.environment, url$6, id);
|
30575
|
-
file ??= url$6[0] === "/" ? slash
|
30611
|
+
file ??= url$6[0] === "/" ? slash(path.join(publicDir, url$6)) : slash(path.resolve(path.dirname(id), url$6));
|
30576
30612
|
}
|
30577
30613
|
let builtUrl;
|
30578
30614
|
if (file) try {
|
@@ -30628,8 +30664,8 @@ function metadataPlugin() {
|
|
30628
30664
|
name: "vite:build-metadata",
|
30629
30665
|
async renderChunk(_code, chunk) {
|
30630
30666
|
chunk.viteMetadata = {
|
30631
|
-
importedAssets: new Set(),
|
30632
|
-
importedCss: new Set()
|
30667
|
+
importedAssets: /* @__PURE__ */ new Set(),
|
30668
|
+
importedCss: /* @__PURE__ */ new Set()
|
30633
30669
|
};
|
30634
30670
|
return null;
|
30635
30671
|
}
|
@@ -30718,7 +30754,7 @@ function parseDynamicImportPattern(strings) {
|
|
30718
30754
|
let globParams = null;
|
30719
30755
|
if (search) {
|
30720
30756
|
search = "?" + search;
|
30721
|
-
if (workerOrSharedWorkerRE.test(search) || urlRE
|
30757
|
+
if (workerOrSharedWorkerRE.test(search) || urlRE.test(search) || rawRE.test(search)) globParams = {
|
30722
30758
|
query: search,
|
30723
30759
|
import: "*"
|
30724
30760
|
};
|
@@ -30734,7 +30770,7 @@ async function transformDynamicImport(importSource, importer, resolve$5, root) {
|
|
30734
30770
|
if (importSource[1] !== "." && importSource[1] !== "/") {
|
30735
30771
|
const resolvedFileName = await resolve$5(importSource.slice(1, -1), importer);
|
30736
30772
|
if (!resolvedFileName) return null;
|
30737
|
-
const relativeFileName = normalizePath
|
30773
|
+
const relativeFileName = normalizePath(posix.relative(posix.dirname(normalizePath(importer)), normalizePath(resolvedFileName)));
|
30738
30774
|
importSource = "`" + (relativeFileName[0] === "." ? "" : "./") + relativeFileName + "`";
|
30739
30775
|
}
|
30740
30776
|
const dynamicImportPattern = parseDynamicImportPattern(importSource);
|
@@ -30760,7 +30796,7 @@ function dynamicImportVarsPlugin(config$2) {
|
|
30760
30796
|
});
|
30761
30797
|
const getFilter = perEnvironmentState((environment) => {
|
30762
30798
|
const { include, exclude } = environment.config.build.dynamicImportVarsOptions;
|
30763
|
-
return createFilter
|
30799
|
+
return createFilter(include, exclude);
|
30764
30800
|
});
|
30765
30801
|
return {
|
30766
30802
|
name: "vite:dynamic-import-vars",
|
@@ -30773,10 +30809,10 @@ function dynamicImportVarsPlugin(config$2) {
|
|
30773
30809
|
transform: { async handler(source, importer) {
|
30774
30810
|
const { environment } = this;
|
30775
30811
|
if (!getFilter(this)(importer) || importer === CLIENT_ENTRY || !hasDynamicImportRE.test(source)) return;
|
30776
|
-
await init
|
30812
|
+
await init;
|
30777
30813
|
let imports = [];
|
30778
30814
|
try {
|
30779
|
-
imports = parse
|
30815
|
+
imports = parse(source)[0];
|
30780
30816
|
} catch {
|
30781
30817
|
return null;
|
30782
30818
|
}
|
@@ -30811,13 +30847,13 @@ function dynamicImportVarsPlugin(config$2) {
|
|
30811
30847
|
//#endregion
|
30812
30848
|
//#region src/node/plugins/pluginFilter.ts
|
30813
30849
|
function getMatcherString(glob$1, cwd) {
|
30814
|
-
if (glob$1.startsWith("**") || path.isAbsolute(glob$1)) return slash
|
30850
|
+
if (glob$1.startsWith("**") || path.isAbsolute(glob$1)) return slash(glob$1);
|
30815
30851
|
const resolved = path.join(cwd, glob$1);
|
30816
|
-
return slash
|
30852
|
+
return slash(resolved);
|
30817
30853
|
}
|
30818
30854
|
function patternToIdFilter(pattern, cwd) {
|
30819
30855
|
if (pattern instanceof RegExp) return (id) => {
|
30820
|
-
const normalizedId = slash
|
30856
|
+
const normalizedId = slash(id);
|
30821
30857
|
const result = pattern.test(normalizedId);
|
30822
30858
|
pattern.lastIndex = 0;
|
30823
30859
|
return result;
|
@@ -30825,7 +30861,7 @@ function patternToIdFilter(pattern, cwd) {
|
|
30825
30861
|
const glob$1 = getMatcherString(pattern, cwd);
|
30826
30862
|
const matcher = picomatch(glob$1, { dot: true });
|
30827
30863
|
return (id) => {
|
30828
|
-
const normalizedId = slash
|
30864
|
+
const normalizedId = slash(id);
|
30829
30865
|
return matcher(normalizedId);
|
30830
30866
|
};
|
30831
30867
|
}
|
@@ -30837,7 +30873,7 @@ function patternToCodeFilter(pattern) {
|
|
30837
30873
|
};
|
30838
30874
|
return (code) => code.includes(pattern);
|
30839
30875
|
}
|
30840
|
-
function createFilter(exclude, include) {
|
30876
|
+
function createFilter$1(exclude, include) {
|
30841
30877
|
if (!exclude && !include) return;
|
30842
30878
|
return (input) => {
|
30843
30879
|
if (exclude?.some((filter$1) => filter$1(input))) return false;
|
@@ -30858,14 +30894,14 @@ function createIdFilter(filter$1, cwd = process.cwd()) {
|
|
30858
30894
|
const { exclude, include } = normalizeFilter(filter$1);
|
30859
30895
|
const excludeFilter = exclude?.map((p$1) => patternToIdFilter(p$1, cwd));
|
30860
30896
|
const includeFilter = include?.map((p$1) => patternToIdFilter(p$1, cwd));
|
30861
|
-
return createFilter(excludeFilter, includeFilter);
|
30897
|
+
return createFilter$1(excludeFilter, includeFilter);
|
30862
30898
|
}
|
30863
30899
|
function createCodeFilter(filter$1) {
|
30864
30900
|
if (!filter$1) return;
|
30865
30901
|
const { exclude, include } = normalizeFilter(filter$1);
|
30866
30902
|
const excludeFilter = exclude?.map(patternToCodeFilter);
|
30867
30903
|
const includeFilter = include?.map(patternToCodeFilter);
|
30868
|
-
return createFilter(excludeFilter, includeFilter);
|
30904
|
+
return createFilter$1(excludeFilter, includeFilter);
|
30869
30905
|
}
|
30870
30906
|
function createFilterForTransform(idFilter, codeFilter, cwd) {
|
30871
30907
|
if (!idFilter && !codeFilter) return;
|
@@ -30885,7 +30921,7 @@ function createFilterForTransform(idFilter, codeFilter, cwd) {
|
|
30885
30921
|
async function resolvePlugins(config$2, prePlugins, normalPlugins, postPlugins) {
|
30886
30922
|
const isBuild = config$2.command === "build";
|
30887
30923
|
const isWorker = config$2.isWorker;
|
30888
|
-
const buildPlugins = isBuild ? await (await import("./dep-
|
30924
|
+
const buildPlugins = isBuild ? await (await import("./dep-DZ1Lk4oF.js")).resolveBuildPlugins(config$2) : {
|
30889
30925
|
pre: [],
|
30890
30926
|
post: []
|
30891
30927
|
};
|
@@ -30895,7 +30931,7 @@ async function resolvePlugins(config$2, prePlugins, normalPlugins, postPlugins)
|
|
30895
30931
|
isBuild ? metadataPlugin() : null,
|
30896
30932
|
!isWorker ? watchPackageDataPlugin(config$2.packageCache) : null,
|
30897
30933
|
!isBuild ? preAliasPlugin(config$2) : null,
|
30898
|
-
alias
|
30934
|
+
alias({
|
30899
30935
|
entries: config$2.resolve.alias,
|
30900
30936
|
customResolver: viteAliasCustomResolver
|
30901
30937
|
}),
|
@@ -30937,7 +30973,7 @@ async function resolvePlugins(config$2, prePlugins, normalPlugins, postPlugins)
|
|
30937
30973
|
].filter(Boolean);
|
30938
30974
|
}
|
30939
30975
|
function createPluginHookUtils(plugins$1) {
|
30940
|
-
const sortedPluginsCache = new Map();
|
30976
|
+
const sortedPluginsCache = /* @__PURE__ */ new Map();
|
30941
30977
|
function getSortedPlugins(hookName) {
|
30942
30978
|
if (sortedPluginsCache.has(hookName)) return sortedPluginsCache.get(hookName);
|
30943
30979
|
const sorted = getSortedPluginsByHook(hookName, plugins$1);
|
@@ -30977,7 +31013,7 @@ function getSortedPluginsByHook(hookName, plugins$1) {
|
|
30977
31013
|
function getHookHandler(hook) {
|
30978
31014
|
return typeof hook === "object" ? hook.handler : hook;
|
30979
31015
|
}
|
30980
|
-
const filterForPlugin = new WeakMap();
|
31016
|
+
const filterForPlugin = /* @__PURE__ */ new WeakMap();
|
30981
31017
|
function getCachedFilterForPlugin(plugin, hookName) {
|
30982
31018
|
let filters = filterForPlugin.get(plugin);
|
30983
31019
|
if (filters && hookName in filters) return filters[hookName];
|
@@ -31043,15 +31079,15 @@ async function createEnvironmentPluginContainer(environment, plugins$1, watcher,
|
|
31043
31079
|
return container;
|
31044
31080
|
}
|
31045
31081
|
var EnvironmentPluginContainer = class {
|
31046
|
-
_pluginContextMap = new Map();
|
31082
|
+
_pluginContextMap = /* @__PURE__ */ new Map();
|
31047
31083
|
_resolvedRollupOptions;
|
31048
|
-
_processesing = new Set();
|
31084
|
+
_processesing = /* @__PURE__ */ new Set();
|
31049
31085
|
_seenResolves = {};
|
31050
|
-
_moduleNodeToLoadAddedImports = new WeakMap();
|
31086
|
+
_moduleNodeToLoadAddedImports = /* @__PURE__ */ new WeakMap();
|
31051
31087
|
getSortedPluginHooks;
|
31052
31088
|
getSortedPlugins;
|
31053
31089
|
moduleGraph;
|
31054
|
-
watchFiles = new Set();
|
31090
|
+
watchFiles = /* @__PURE__ */ new Set();
|
31055
31091
|
minimalContext;
|
31056
31092
|
_started = false;
|
31057
31093
|
_buildStartPromise;
|
@@ -31190,7 +31226,7 @@ var EnvironmentPluginContainer = class {
|
|
31190
31226
|
}
|
31191
31227
|
}
|
31192
31228
|
if (id) {
|
31193
|
-
partial.id = isExternalUrl(id) ? id : normalizePath
|
31229
|
+
partial.id = isExternalUrl(id) ? id : normalizePath(id);
|
31194
31230
|
return partial;
|
31195
31231
|
} else return null;
|
31196
31232
|
}
|
@@ -31206,7 +31242,7 @@ var EnvironmentPluginContainer = class {
|
|
31206
31242
|
const handler = getHookHandler(plugin.load);
|
31207
31243
|
const result = await this.handleHookPromise(handler.call(ctx, id, options$1));
|
31208
31244
|
if (result != null) {
|
31209
|
-
if (isObject
|
31245
|
+
if (isObject(result)) ctx._updateModuleInfo(id, result);
|
31210
31246
|
this._updateModuleLoadAddedImports(id, ctx._addedImports);
|
31211
31247
|
return result;
|
31212
31248
|
}
|
@@ -31238,7 +31274,7 @@ var EnvironmentPluginContainer = class {
|
|
31238
31274
|
}
|
31239
31275
|
if (!result) continue;
|
31240
31276
|
debugPluginTransform?.(timeFrom(start), plugin.name, prettifyUrl(id, this.environment.config.root));
|
31241
|
-
if (isObject
|
31277
|
+
if (isObject(result)) {
|
31242
31278
|
if (result.code !== void 0) {
|
31243
31279
|
code = result.code;
|
31244
31280
|
if (result.map) {
|
@@ -31360,7 +31396,7 @@ var PluginContext = class extends MinimalPluginContext {
|
|
31360
31396
|
return out;
|
31361
31397
|
}
|
31362
31398
|
async load(options$1) {
|
31363
|
-
await this._container.moduleGraph?.ensureEntryFromUrl(unwrapId
|
31399
|
+
await this._container.moduleGraph?.ensureEntryFromUrl(unwrapId(options$1.id));
|
31364
31400
|
this._updateModuleInfo(options$1.id, options$1);
|
31365
31401
|
const loadResult = await this._container.load(options$1.id);
|
31366
31402
|
const code = typeof loadResult === "object" ? loadResult?.code : loadResult;
|
@@ -31442,7 +31478,7 @@ var PluginContext = class extends MinimalPluginContext {
|
|
31442
31478
|
if (!err$2.frame) {
|
31443
31479
|
let code = this._activeCode;
|
31444
31480
|
if (err$2.loc.file) {
|
31445
|
-
err$2.id = normalizePath
|
31481
|
+
err$2.id = normalizePath(err$2.loc.file);
|
31446
31482
|
try {
|
31447
31483
|
code = fs.readFileSync(err$2.loc.file, "utf-8");
|
31448
31484
|
} catch {}
|
@@ -31461,7 +31497,7 @@ var PluginContext = class extends MinimalPluginContext {
|
|
31461
31497
|
const rawSourceMap = this._getCombinedSourcemap();
|
31462
31498
|
if (rawSourceMap && "version" in rawSourceMap) {
|
31463
31499
|
const traced = new TraceMap(rawSourceMap);
|
31464
|
-
const { source, line, column } = originalPositionFor
|
31500
|
+
const { source, line, column } = originalPositionFor(traced, {
|
31465
31501
|
line: Number(err$2.loc.line),
|
31466
31502
|
column: Number(err$2.loc.column)
|
31467
31503
|
});
|
@@ -31476,7 +31512,7 @@ var PluginContext = class extends MinimalPluginContext {
|
|
31476
31512
|
if (!err$2.frame) {
|
31477
31513
|
let code = err$2.pluginCode;
|
31478
31514
|
if (err$2.loc.file) {
|
31479
|
-
err$2.id = normalizePath
|
31515
|
+
err$2.id = normalizePath(err$2.loc.file);
|
31480
31516
|
if (!code) try {
|
31481
31517
|
code = fs.readFileSync(err$2.loc.file, "utf-8");
|
31482
31518
|
} catch {}
|
@@ -31505,7 +31541,7 @@ var LoadPluginContext = class extends PluginContext {
|
|
31505
31541
|
super(null, container);
|
31506
31542
|
}
|
31507
31543
|
addWatchFile(id) {
|
31508
|
-
if (!this._addedImports) this._addedImports = new Set();
|
31544
|
+
if (!this._addedImports) this._addedImports = /* @__PURE__ */ new Set();
|
31509
31545
|
this._addedImports.add(id);
|
31510
31546
|
super.addWatchFile(id);
|
31511
31547
|
}
|
@@ -31662,11 +31698,11 @@ function createBackCompatIdResolver(config$2, options$1) {
|
|
31662
31698
|
*/
|
31663
31699
|
function createIdResolver(config$2, options$1) {
|
31664
31700
|
const scan = options$1?.scan;
|
31665
|
-
const pluginContainerMap = new Map();
|
31701
|
+
const pluginContainerMap = /* @__PURE__ */ new Map();
|
31666
31702
|
async function resolve$5(environment, id, importer) {
|
31667
31703
|
let pluginContainer = pluginContainerMap.get(environment);
|
31668
31704
|
if (!pluginContainer) {
|
31669
|
-
pluginContainer = await createEnvironmentPluginContainer(environment, [alias
|
31705
|
+
pluginContainer = await createEnvironmentPluginContainer(environment, [alias({ entries: environment.config.resolve.alias }), resolvePlugin({
|
31670
31706
|
root: config$2.root,
|
31671
31707
|
isProduction: config$2.isProduction,
|
31672
31708
|
isBuild: config$2.command === "build",
|
@@ -31680,11 +31716,11 @@ function createIdResolver(config$2, options$1) {
|
|
31680
31716
|
}
|
31681
31717
|
return await pluginContainer.resolveId(id, importer, { scan });
|
31682
31718
|
}
|
31683
|
-
const aliasOnlyPluginContainerMap = new Map();
|
31719
|
+
const aliasOnlyPluginContainerMap = /* @__PURE__ */ new Map();
|
31684
31720
|
async function resolveAlias(environment, id, importer) {
|
31685
31721
|
let pluginContainer = aliasOnlyPluginContainerMap.get(environment);
|
31686
31722
|
if (!pluginContainer) {
|
31687
|
-
pluginContainer = await createEnvironmentPluginContainer(environment, [alias
|
31723
|
+
pluginContainer = await createEnvironmentPluginContainer(environment, [alias({ entries: environment.config.resolve.alias })], void 0, false);
|
31688
31724
|
aliasOnlyPluginContainerMap.set(environment, pluginContainer);
|
31689
31725
|
}
|
31690
31726
|
return await pluginContainer.resolveId(id, importer, { scan });
|
@@ -31741,10 +31777,10 @@ var PostCssDialectLang = /* @__PURE__ */ function(PostCssDialectLang$1) {
|
|
31741
31777
|
const isModuleCSSRequest = (request) => cssModuleRE.test(request);
|
31742
31778
|
const isDirectCSSRequest = (request) => CSS_LANGS_RE.test(request) && directRequestRE.test(request);
|
31743
31779
|
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();
|
31780
|
+
const cssModulesCache = /* @__PURE__ */ new WeakMap();
|
31781
|
+
const removedPureCssFilesCache = /* @__PURE__ */ new WeakMap();
|
31782
|
+
const cssBundleNameCache = /* @__PURE__ */ new WeakMap();
|
31783
|
+
const postcssConfigCache = /* @__PURE__ */ new WeakMap();
|
31748
31784
|
function encodePublicUrlsInCSS(config$2) {
|
31749
31785
|
return config$2.command === "build";
|
31750
31786
|
}
|
@@ -31765,9 +31801,9 @@ function cssPlugin(config$2) {
|
|
31765
31801
|
return {
|
31766
31802
|
name: "vite:css",
|
31767
31803
|
buildStart() {
|
31768
|
-
moduleCache = new Map();
|
31804
|
+
moduleCache = /* @__PURE__ */ new Map();
|
31769
31805
|
cssModulesCache.set(config$2, moduleCache);
|
31770
|
-
removedPureCssFilesCache.set(config$2, new Map());
|
31806
|
+
removedPureCssFilesCache.set(config$2, /* @__PURE__ */ new Map());
|
31771
31807
|
preprocessorWorkerController = createPreprocessorWorkerController(normalizeMaxWorkers(config$2.css.preprocessorMaxWorkers));
|
31772
31808
|
preprocessorWorkerControllerCache.set(config$2, preprocessorWorkerController);
|
31773
31809
|
},
|
@@ -31776,7 +31812,7 @@ function cssPlugin(config$2) {
|
|
31776
31812
|
},
|
31777
31813
|
load: { async handler(id) {
|
31778
31814
|
if (!isCSSRequest(id)) return;
|
31779
|
-
if (urlRE
|
31815
|
+
if (urlRE.test(id)) {
|
31780
31816
|
if (isModuleCSSRequest(id)) throw new Error(`?url is not supported with CSS modules. (tried to import ${JSON.stringify(id)})`);
|
31781
31817
|
if (isBuild) {
|
31782
31818
|
id = injectQuery(removeUrlQuery(id), "transform-only");
|
@@ -31818,7 +31854,7 @@ function cssPlugin(config$2) {
|
|
31818
31854
|
* Plugin applied after user plugins
|
31819
31855
|
*/
|
31820
31856
|
function cssPostPlugin(config$2) {
|
31821
|
-
const styles = new Map();
|
31857
|
+
const styles = /* @__PURE__ */ new Map();
|
31822
31858
|
let codeSplitEmitQueue = createSerialPromiseQueue();
|
31823
31859
|
const urlEmitQueue = createSerialPromiseQueue();
|
31824
31860
|
let pureCssChunks;
|
@@ -31849,9 +31885,9 @@ function cssPostPlugin(config$2) {
|
|
31849
31885
|
return {
|
31850
31886
|
name: "vite:css-post",
|
31851
31887
|
renderStart() {
|
31852
|
-
pureCssChunks = new Set();
|
31888
|
+
pureCssChunks = /* @__PURE__ */ new Set();
|
31853
31889
|
hasEmitted = false;
|
31854
|
-
chunkCSSMap = new Map();
|
31890
|
+
chunkCSSMap = /* @__PURE__ */ new Map();
|
31855
31891
|
codeSplitEmitQueue = createSerialPromiseQueue();
|
31856
31892
|
},
|
31857
31893
|
transform: { async handler(css, id) {
|
@@ -31935,9 +31971,9 @@ function cssPostPlugin(config$2) {
|
|
31935
31971
|
const resolveAssetUrlsInCss = (chunkCSS$1, cssAssetName) => {
|
31936
31972
|
const encodedPublicUrls = encodePublicUrlsInCSS(config$2);
|
31937
31973
|
const relative$3 = config$2.base === "./" || config$2.base === "";
|
31938
|
-
const cssAssetDirname = encodedPublicUrls || relative$3 ? slash
|
31974
|
+
const cssAssetDirname = encodedPublicUrls || relative$3 ? slash(getCssAssetDirname(cssAssetName)) : void 0;
|
31939
31975
|
const toRelative = (filename) => {
|
31940
|
-
const relativePath = normalizePath
|
31976
|
+
const relativePath = normalizePath(path.relative(cssAssetDirname, filename));
|
31941
31977
|
return relativePath[0] === "." ? relativePath : "./" + relativePath;
|
31942
31978
|
};
|
31943
31979
|
chunkCSS$1 = chunkCSS$1.replace(assetUrlRE, (_, fileHash, postfix = "") => {
|
@@ -31946,7 +31982,7 @@ function cssPostPlugin(config$2) {
|
|
31946
31982
|
return encodeURIPath(toOutputFilePathInCss(filename, "asset", cssAssetName, "css", config$2, toRelative));
|
31947
31983
|
});
|
31948
31984
|
if (encodedPublicUrls) {
|
31949
|
-
const relativePathToPublicFromCSS = normalizePath
|
31985
|
+
const relativePathToPublicFromCSS = normalizePath(path.relative(cssAssetDirname, ""));
|
31950
31986
|
chunkCSS$1 = chunkCSS$1.replace(publicAssetUrlRE, (_, hash$1) => {
|
31951
31987
|
const publicUrl = publicAssetUrlMap.get(hash$1).slice(1);
|
31952
31988
|
return encodeURIPath(toOutputFilePathInCss(publicUrl, "public", cssAssetName, "css", config$2, () => `${relativePathToPublicFromCSS}/${publicUrl}`));
|
@@ -31955,7 +31991,7 @@ function cssPostPlugin(config$2) {
|
|
31955
31991
|
return chunkCSS$1;
|
31956
31992
|
};
|
31957
31993
|
function ensureFileExt(name, ext) {
|
31958
|
-
return normalizePath
|
31994
|
+
return normalizePath(path.format({
|
31959
31995
|
...path.parse(name),
|
31960
31996
|
base: void 0,
|
31961
31997
|
ext
|
@@ -32065,8 +32101,8 @@ function cssPostPlugin(config$2) {
|
|
32065
32101
|
if (opts.__vite_skip_asset_emit__) return;
|
32066
32102
|
if (!this.environment.config.build.cssCodeSplit && !hasEmitted) {
|
32067
32103
|
let extractedCss = "";
|
32068
|
-
const collected = new Set();
|
32069
|
-
const dynamicImports = new Set();
|
32104
|
+
const collected = /* @__PURE__ */ new Set();
|
32105
|
+
const dynamicImports = /* @__PURE__ */ new Set();
|
32070
32106
|
function collect(chunk) {
|
32071
32107
|
if (!chunk || chunk.type !== "chunk" || collected.has(chunk)) return;
|
32072
32108
|
collected.add(chunk);
|
@@ -32131,14 +32167,14 @@ function cssAnalysisPlugin(config$2) {
|
|
32131
32167
|
const isSelfAccepting = !cssModulesCache.get(config$2)?.get(id) && !inlineRE.test(id) && !htmlProxyRE.test(id);
|
32132
32168
|
const pluginImports = this._addedImports;
|
32133
32169
|
if (pluginImports) {
|
32134
|
-
const depModules = new Set();
|
32170
|
+
const depModules = /* @__PURE__ */ new Set();
|
32135
32171
|
for (const file of pluginImports) if (isCSSRequest(file)) depModules.add(moduleGraph.createFileOnlyEntry(file));
|
32136
32172
|
else {
|
32137
32173
|
const url$6 = await fileToDevUrl(this.environment, file, true);
|
32138
32174
|
if (url$6.startsWith("data:")) depModules.add(moduleGraph.createFileOnlyEntry(file));
|
32139
32175
|
else depModules.add(await moduleGraph.ensureEntryFromUrl(url$6));
|
32140
32176
|
}
|
32141
|
-
moduleGraph.updateModuleInfo(thisModule, depModules, null, new Set(), null, isSelfAccepting);
|
32177
|
+
moduleGraph.updateModuleInfo(thisModule, depModules, null, /* @__PURE__ */ new Set(), null, isSelfAccepting);
|
32142
32178
|
} else thisModule.isSelfAccepting = isSelfAccepting;
|
32143
32179
|
}
|
32144
32180
|
} }
|
@@ -32197,7 +32233,7 @@ function createCSSResolvers(config$2) {
|
|
32197
32233
|
preferRelative: true
|
32198
32234
|
});
|
32199
32235
|
sassResolve = async (...args) => {
|
32200
|
-
if (args[1].startsWith("file://")) args[1] = fileURLToPath(args[1], { windows: isWindows
|
32236
|
+
if (args[1].startsWith("file://")) args[1] = fileURLToPath(args[1], { windows: isWindows && !fileURLWithWindowsDriveRE.test(args[1]) ? false : void 0 });
|
32201
32237
|
return resolver(...args);
|
32202
32238
|
};
|
32203
32239
|
}
|
@@ -32235,8 +32271,8 @@ async function compileCSSPreprocessors(environment, id, lang, code, workerContro
|
|
32235
32271
|
if (preprocessResult.error) throw preprocessResult.error;
|
32236
32272
|
let deps;
|
32237
32273
|
if (preprocessResult.deps.length > 0) {
|
32238
|
-
const normalizedFilename = normalizePath
|
32239
|
-
deps = new Set([...preprocessResult.deps].filter((dep) => normalizePath
|
32274
|
+
const normalizedFilename = normalizePath(opts.filename);
|
32275
|
+
deps = new Set([...preprocessResult.deps].filter((dep) => normalizePath(dep) !== normalizedFilename));
|
32240
32276
|
}
|
32241
32277
|
return {
|
32242
32278
|
code: preprocessResult.code,
|
@@ -32244,7 +32280,7 @@ async function compileCSSPreprocessors(environment, id, lang, code, workerContro
|
|
32244
32280
|
deps
|
32245
32281
|
};
|
32246
32282
|
}
|
32247
|
-
const configToAtImportResolvers = new WeakMap();
|
32283
|
+
const configToAtImportResolvers = /* @__PURE__ */ new WeakMap();
|
32248
32284
|
function getAtImportResolvers(config$2) {
|
32249
32285
|
let atImportResolvers = configToAtImportResolvers.get(config$2);
|
32250
32286
|
if (!atImportResolvers) {
|
@@ -32256,7 +32292,7 @@ function getAtImportResolvers(config$2) {
|
|
32256
32292
|
async function compileCSS(environment, id, code, workerController, urlResolver) {
|
32257
32293
|
const { config: config$2 } = environment;
|
32258
32294
|
const lang = CSS_LANGS_RE.exec(id)?.[1];
|
32259
|
-
const deps = new Set();
|
32295
|
+
const deps = /* @__PURE__ */ new Set();
|
32260
32296
|
let preprocessorMap;
|
32261
32297
|
if (isPreProcessor(lang)) {
|
32262
32298
|
const preprocessorResult = await compileCSSPreprocessors(environment, id, lang, code, workerController);
|
@@ -32367,7 +32403,7 @@ async function runPostCSS(id, code, plugins$1, options$1, deps, logger, enableSo
|
|
32367
32403
|
sourcesContent: true
|
32368
32404
|
} } : {}
|
32369
32405
|
});
|
32370
|
-
for (const message of postcssResult.messages) if (message.type === "dependency") deps?.add(normalizePath
|
32406
|
+
for (const message of postcssResult.messages) if (message.type === "dependency") deps?.add(normalizePath(message.file));
|
32371
32407
|
else if (message.type === "dir-dependency") {
|
32372
32408
|
const { dir, glob: globPattern = "**" } = message;
|
32373
32409
|
const files = globSync(globPattern, {
|
@@ -32420,10 +32456,10 @@ function createCachedImport(imp) {
|
|
32420
32456
|
return cached;
|
32421
32457
|
};
|
32422
32458
|
}
|
32423
|
-
const importPostcssImport = createCachedImport(() => import("./dep-
|
32424
|
-
const importPostcssModules = createCachedImport(() => import("./dep-
|
32459
|
+
const importPostcssImport = createCachedImport(() => import("./dep-BYhaRSbV.js").then(__toDynamicImportESM(1)));
|
32460
|
+
const importPostcssModules = createCachedImport(() => import("./dep-8cccGkwy.js").then(__toDynamicImportESM(1)));
|
32425
32461
|
const importPostcss = createCachedImport(() => import("postcss"));
|
32426
|
-
const preprocessorWorkerControllerCache = new WeakMap();
|
32462
|
+
const preprocessorWorkerControllerCache = /* @__PURE__ */ new WeakMap();
|
32427
32463
|
let alwaysFakeWorkerWorkerControllerCache;
|
32428
32464
|
/**
|
32429
32465
|
* @experimental
|
@@ -32442,7 +32478,7 @@ async function formatPostcssSourceMap(rawMap, file) {
|
|
32442
32478
|
const sources = rawMap.sources.map((source) => {
|
32443
32479
|
const cleanSource = cleanUrl(decodeURIComponent(source));
|
32444
32480
|
if (cleanSource[0] === "<" && cleanSource.endsWith(">")) return `\0${cleanSource}`;
|
32445
|
-
return normalizePath
|
32481
|
+
return normalizePath(path.resolve(inputFileDir, cleanSource));
|
32446
32482
|
});
|
32447
32483
|
return {
|
32448
32484
|
file,
|
@@ -32470,7 +32506,7 @@ async function resolvePostcssConfig(config$2) {
|
|
32470
32506
|
let result = postcssConfigCache.get(config$2);
|
32471
32507
|
if (result !== void 0) return await result;
|
32472
32508
|
const inlineOptions = config$2.css.postcss;
|
32473
|
-
if (isObject
|
32509
|
+
if (isObject(inlineOptions)) {
|
32474
32510
|
const options$1 = { ...inlineOptions };
|
32475
32511
|
delete options$1.plugins;
|
32476
32512
|
result = {
|
@@ -32814,7 +32850,7 @@ const scssProcessor = (maxWorkers) => {
|
|
32814
32850
|
const result = await worker.run(sassPackage.path, data, optionsWithoutAdditionalData);
|
32815
32851
|
const deps = result.stats.includedFiles.map((f$1) => cleanScssBugUrl(f$1));
|
32816
32852
|
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
|
32853
|
+
if (map$1) map$1.sources = map$1.sources.map((url$6) => url$6.startsWith("file://") ? normalizePath(fileURLToPath(url$6)) : url$6);
|
32818
32854
|
return {
|
32819
32855
|
code: result.css.toString(),
|
32820
32856
|
map: map$1,
|
@@ -32859,7 +32895,7 @@ async function rebaseUrls(environment, file, rootFile, resolver, ignoreUrl) {
|
|
32859
32895
|
if (unquotedUrl[0] === "/") return unquotedUrl;
|
32860
32896
|
const absolute = await resolver(environment, unquotedUrl, file) || path.resolve(fileDir, unquotedUrl);
|
32861
32897
|
const relative$3 = path.relative(rootDir, absolute);
|
32862
|
-
return normalizePath
|
32898
|
+
return normalizePath(relative$3);
|
32863
32899
|
};
|
32864
32900
|
if (hasImportCss) rebased = await rewriteImportCss(content, rebaseFn);
|
32865
32901
|
if (hasUrls) rebased = await rewriteCssUrls(rebased || content, rebaseFn);
|
@@ -33056,7 +33092,7 @@ const stylProcessor = (maxWorkers) => {
|
|
33056
33092
|
function formatStylusSourceMap(mapBefore, root) {
|
33057
33093
|
if (!mapBefore) return void 0;
|
33058
33094
|
const map$1 = { ...mapBefore };
|
33059
|
-
const resolveFromRoot = (p$1) => normalizePath
|
33095
|
+
const resolveFromRoot = (p$1) => normalizePath(path.resolve(root, p$1));
|
33060
33096
|
if (map$1.file) map$1.file = resolveFromRoot(map$1.file);
|
33061
33097
|
map$1.sources = map$1.sources.map(resolveFromRoot);
|
33062
33098
|
return map$1;
|
@@ -33323,7 +33359,7 @@ const esMap = {
|
|
33323
33359
|
};
|
33324
33360
|
const esRE = /es(\d{4})/;
|
33325
33361
|
const versionRE = /\d/;
|
33326
|
-
const convertTargetsCache = new Map();
|
33362
|
+
const convertTargetsCache = /* @__PURE__ */ new Map();
|
33327
33363
|
const convertTargets = (esbuildTarget) => {
|
33328
33364
|
if (!esbuildTarget) return {};
|
33329
33365
|
const cached = convertTargetsCache.get(esbuildTarget);
|
@@ -33379,7 +33415,7 @@ const preloadMarker = `__VITE_PRELOAD__`;
|
|
33379
33415
|
const preloadHelperId = "\0vite/preload-helper.js";
|
33380
33416
|
const preloadMarkerRE = new RegExp(preloadMarker, "g");
|
33381
33417
|
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;
|
33418
|
+
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
33419
|
function toRelativePath(filename, importer) {
|
33384
33420
|
const relPath = path.posix.relative(path.posix.dirname(importer), filename);
|
33385
33421
|
return relPath[0] === "." ? relPath : `./${relPath}`;
|
@@ -33476,11 +33512,11 @@ function buildImportAnalysisPlugin(config$2) {
|
|
33476
33512
|
}
|
33477
33513
|
} },
|
33478
33514
|
transform: { async handler(source, importer) {
|
33479
|
-
if (
|
33480
|
-
await init
|
33515
|
+
if (!dynamicImportPrefixRE.test(source)) return;
|
33516
|
+
await init;
|
33481
33517
|
let imports = [];
|
33482
33518
|
try {
|
33483
|
-
imports = parse
|
33519
|
+
imports = parse(source)[0];
|
33484
33520
|
} catch (_e) {
|
33485
33521
|
const e$1 = _e;
|
33486
33522
|
const { message, showCodeFrame } = createParseErrorInfo(importer, source);
|
@@ -33560,7 +33596,7 @@ function buildImportAnalysisPlugin(config$2) {
|
|
33560
33596
|
const code = chunk.code;
|
33561
33597
|
let imports;
|
33562
33598
|
try {
|
33563
|
-
imports = parse
|
33599
|
+
imports = parse(code)[0].filter((i$1) => i$1.d > -1);
|
33564
33600
|
} catch (e$1) {
|
33565
33601
|
const loc = numberToPos(code, e$1.idx);
|
33566
33602
|
this.error({
|
@@ -33599,7 +33635,7 @@ function buildImportAnalysisPlugin(config$2) {
|
|
33599
33635
|
const code = chunk.code;
|
33600
33636
|
let imports;
|
33601
33637
|
try {
|
33602
|
-
imports = parse
|
33638
|
+
imports = parse(code)[0].filter((i$1) => i$1.d > -1);
|
33603
33639
|
} catch (e$1) {
|
33604
33640
|
const loc = numberToPos(code, e$1.idx);
|
33605
33641
|
this.error({
|
@@ -33616,7 +33652,7 @@ function buildImportAnalysisPlugin(config$2) {
|
|
33616
33652
|
});
|
33617
33653
|
}
|
33618
33654
|
const s$2 = new MagicString(code);
|
33619
|
-
const rewroteMarkerStartPos = new Set();
|
33655
|
+
const rewroteMarkerStartPos = /* @__PURE__ */ new Set();
|
33620
33656
|
const fileDeps = [];
|
33621
33657
|
const addFileDep = (url$6, runtime = false) => {
|
33622
33658
|
const index = fileDeps.findIndex((dep) => dep.url === url$6);
|
@@ -33633,13 +33669,13 @@ function buildImportAnalysisPlugin(config$2) {
|
|
33633
33669
|
const rawUrl = code.slice(start, end);
|
33634
33670
|
if (rawUrl[0] === `"` && rawUrl.endsWith(`"`)) url$6 = rawUrl.slice(1, -1);
|
33635
33671
|
}
|
33636
|
-
const deps = new Set();
|
33672
|
+
const deps = /* @__PURE__ */ new Set();
|
33637
33673
|
let hasRemovedPureCssChunk = false;
|
33638
33674
|
let normalizedFile = void 0;
|
33639
33675
|
if (url$6) {
|
33640
33676
|
normalizedFile = path.posix.join(path.posix.dirname(chunk.fileName), url$6);
|
33641
33677
|
const ownerFilename = chunk.fileName;
|
33642
|
-
const analyzed = new Set();
|
33678
|
+
const analyzed = /* @__PURE__ */ new Set();
|
33643
33679
|
const addDeps = (filename) => {
|
33644
33680
|
if (filename === ownerFilename) return;
|
33645
33681
|
if (analyzed.has(filename)) return;
|
@@ -33717,7 +33753,7 @@ function buildImportAnalysisPlugin(config$2) {
|
|
33717
33753
|
const originalDebugId = chunk.map.debugId;
|
33718
33754
|
chunk.map = map$1;
|
33719
33755
|
if (buildSourcemap === "inline") {
|
33720
|
-
chunk.code = chunk.code.replace(import_convert_source_map.
|
33756
|
+
chunk.code = chunk.code.replace(import_convert_source_map.mapFileCommentRegex, "");
|
33721
33757
|
chunk.code += `\n//# sourceMappingURL=${genSourceMapUrl(map$1)}`;
|
33722
33758
|
} else {
|
33723
33759
|
if (originalDebugId) map$1.debugId = originalDebugId;
|
@@ -33751,7 +33787,7 @@ function ssrManifestPlugin() {
|
|
33751
33787
|
const chunk = bundle[file];
|
33752
33788
|
if (chunk.type === "chunk") {
|
33753
33789
|
for (const id in chunk.modules) {
|
33754
|
-
const normalizedId = normalizePath
|
33790
|
+
const normalizedId = normalizePath(relative(config$2.root, id));
|
33755
33791
|
const mappedChunks = ssrManifest[normalizedId] ?? (ssrManifest[normalizedId] = []);
|
33756
33792
|
if (!chunk.isEntry) {
|
33757
33793
|
mappedChunks.push(joinUrlSegments(base, chunk.fileName));
|
@@ -33767,7 +33803,7 @@ function ssrManifestPlugin() {
|
|
33767
33803
|
const code = chunk.code;
|
33768
33804
|
let imports = [];
|
33769
33805
|
try {
|
33770
|
-
imports = parse
|
33806
|
+
imports = parse(code)[0].filter((i$1) => i$1.n && i$1.d > -1);
|
33771
33807
|
} catch (_e) {
|
33772
33808
|
const e$1 = _e;
|
33773
33809
|
const loc = numberToPos(code, e$1.idx);
|
@@ -33789,7 +33825,7 @@ function ssrManifestPlugin() {
|
|
33789
33825
|
const url$6 = code.slice(start, end);
|
33790
33826
|
const deps = [];
|
33791
33827
|
const ownerFilename = chunk.fileName;
|
33792
|
-
const analyzed = new Set();
|
33828
|
+
const analyzed = /* @__PURE__ */ new Set();
|
33793
33829
|
const addDeps = (filename) => {
|
33794
33830
|
if (filename === ownerFilename) return;
|
33795
33831
|
if (analyzed.has(filename)) return;
|
@@ -33802,7 +33838,7 @@ function ssrManifestPlugin() {
|
|
33802
33838
|
chunk$1.imports.forEach(addDeps);
|
33803
33839
|
}
|
33804
33840
|
};
|
33805
|
-
const normalizedFile = normalizePath
|
33841
|
+
const normalizedFile = normalizePath(join(dirname(chunk.fileName), url$6.slice(1, -1)));
|
33806
33842
|
addDeps(normalizedFile);
|
33807
33843
|
ssrManifest[basename(name)] = deps;
|
33808
33844
|
}
|
@@ -33963,8 +33999,7 @@ function resolveConfigToBuild(inlineConfig = {}, patchConfig, patchPlugins) {
|
|
33963
33999
|
* Build an App environment, or a App library (if libraryOptions is provided)
|
33964
34000
|
**/
|
33965
34001
|
async function buildEnvironment(environment) {
|
33966
|
-
const { root, packageCache } = environment.config;
|
33967
|
-
const options$1 = environment.config.build;
|
34002
|
+
const { root, packageCache, build: options$1 } = environment.config;
|
33968
34003
|
const libOptions = options$1.lib;
|
33969
34004
|
const { logger } = environment;
|
33970
34005
|
const ssr = environment.config.consumer === "server";
|
@@ -34370,8 +34405,8 @@ function toOutputFilePathWithoutRuntime(filename, type, hostId, hostType, config
|
|
34370
34405
|
const toOutputFilePathInCss = toOutputFilePathWithoutRuntime;
|
34371
34406
|
const toOutputFilePathInHtml = toOutputFilePathWithoutRuntime;
|
34372
34407
|
function areSeparateFolders(a, b) {
|
34373
|
-
const na = normalizePath
|
34374
|
-
const nb = normalizePath
|
34408
|
+
const na = normalizePath(a);
|
34409
|
+
const nb = normalizePath(b);
|
34375
34410
|
return na !== nb && !na.startsWith(withTrailingSlash(nb)) && !nb.startsWith(withTrailingSlash(na));
|
34376
34411
|
}
|
34377
34412
|
var BuildEnvironment = class extends BaseEnvironment {
|
@@ -34522,7 +34557,7 @@ async function fetchModule(environment, url$6, importer, options$1 = {}) {
|
|
34522
34557
|
type
|
34523
34558
|
};
|
34524
34559
|
}
|
34525
|
-
url$6 = unwrapId
|
34560
|
+
url$6 = unwrapId(url$6);
|
34526
34561
|
const mod = await environment.moduleGraph.ensureEntryFromUrl(url$6);
|
34527
34562
|
const cached = !!mod.transformResult;
|
34528
34563
|
if (options$1.cached && cached) return { cache: true };
|
@@ -34937,9 +34972,9 @@ var EnvironmentModuleNode = class {
|
|
34937
34972
|
type;
|
34938
34973
|
info;
|
34939
34974
|
meta;
|
34940
|
-
importers = new Set();
|
34941
|
-
importedModules = new Set();
|
34942
|
-
acceptedHmrDeps = new Set();
|
34975
|
+
importers = /* @__PURE__ */ new Set();
|
34976
|
+
importedModules = /* @__PURE__ */ new Set();
|
34977
|
+
acceptedHmrDeps = /* @__PURE__ */ new Set();
|
34943
34978
|
acceptedHmrExports = null;
|
34944
34979
|
importedBindings = null;
|
34945
34980
|
isSelfAccepting;
|
@@ -34985,20 +35020,20 @@ var EnvironmentModuleNode = class {
|
|
34985
35020
|
};
|
34986
35021
|
var EnvironmentModuleGraph = class {
|
34987
35022
|
environment;
|
34988
|
-
urlToModuleMap = new Map();
|
34989
|
-
idToModuleMap = new Map();
|
34990
|
-
etagToModuleMap = new Map();
|
34991
|
-
fileToModulesMap = new Map();
|
35023
|
+
urlToModuleMap = /* @__PURE__ */ new Map();
|
35024
|
+
idToModuleMap = /* @__PURE__ */ new Map();
|
35025
|
+
etagToModuleMap = /* @__PURE__ */ new Map();
|
35026
|
+
fileToModulesMap = /* @__PURE__ */ new Map();
|
34992
35027
|
/**
|
34993
35028
|
* @internal
|
34994
35029
|
*/
|
34995
|
-
_unresolvedUrlToModuleMap = new Map();
|
35030
|
+
_unresolvedUrlToModuleMap = /* @__PURE__ */ new Map();
|
34996
35031
|
/**
|
34997
35032
|
* @internal
|
34998
35033
|
*/
|
34999
35034
|
_resolveId;
|
35000
35035
|
/** @internal */
|
35001
|
-
_hasResolveFailedErrorModules = new Set();
|
35036
|
+
_hasResolveFailedErrorModules = /* @__PURE__ */ new Set();
|
35002
35037
|
constructor(environment, resolveId) {
|
35003
35038
|
this.environment = environment;
|
35004
35039
|
this._resolveId = resolveId;
|
@@ -35019,7 +35054,7 @@ var EnvironmentModuleGraph = class {
|
|
35019
35054
|
onFileChange(file) {
|
35020
35055
|
const mods = this.getModulesByFile(file);
|
35021
35056
|
if (mods) {
|
35022
|
-
const seen$1 = new Set();
|
35057
|
+
const seen$1 = /* @__PURE__ */ new Set();
|
35023
35058
|
mods.forEach((mod) => {
|
35024
35059
|
this.invalidateModule(mod, seen$1);
|
35025
35060
|
});
|
@@ -35033,7 +35068,7 @@ var EnvironmentModuleGraph = class {
|
|
35033
35068
|
});
|
35034
35069
|
});
|
35035
35070
|
}
|
35036
|
-
invalidateModule(mod, seen$1 = new Set(), timestamp =
|
35071
|
+
invalidateModule(mod, seen$1 = /* @__PURE__ */ new Set(), timestamp = monotonicDateNow(), isHmr = false, softInvalidate = false) {
|
35037
35072
|
const prevInvalidationState = mod.invalidationState;
|
35038
35073
|
if (softInvalidate) mod.invalidationState ??= mod.transformResult ?? "HARD_INVALIDATED";
|
35039
35074
|
else mod.invalidationState = "HARD_INVALIDATED";
|
@@ -35057,8 +35092,8 @@ var EnvironmentModuleGraph = class {
|
|
35057
35092
|
this._hasResolveFailedErrorModules.delete(mod);
|
35058
35093
|
}
|
35059
35094
|
invalidateAll() {
|
35060
|
-
const timestamp =
|
35061
|
-
const seen$1 = new Set();
|
35095
|
+
const timestamp = monotonicDateNow();
|
35096
|
+
const seen$1 = /* @__PURE__ */ new Set();
|
35062
35097
|
this.idToModuleMap.forEach((mod) => {
|
35063
35098
|
this.invalidateModule(mod, seen$1, timestamp);
|
35064
35099
|
});
|
@@ -35095,7 +35130,7 @@ var EnvironmentModuleGraph = class {
|
|
35095
35130
|
prevImports.forEach((dep) => {
|
35096
35131
|
if (!mod.importedModules.has(dep)) {
|
35097
35132
|
dep.importers.delete(mod);
|
35098
|
-
if (!dep.importers.size) (noLongerImported || (noLongerImported = new Set())).add(dep);
|
35133
|
+
if (!dep.importers.size) (noLongerImported || (noLongerImported = /* @__PURE__ */ new Set())).add(dep);
|
35099
35134
|
}
|
35100
35135
|
});
|
35101
35136
|
resolvePromises = [];
|
@@ -35137,7 +35172,7 @@ var EnvironmentModuleGraph = class {
|
|
35137
35172
|
const file = mod.file = cleanUrl(resolvedId);
|
35138
35173
|
let fileMappedModules = this.fileToModulesMap.get(file);
|
35139
35174
|
if (!fileMappedModules) {
|
35140
|
-
fileMappedModules = new Set();
|
35175
|
+
fileMappedModules = /* @__PURE__ */ new Set();
|
35141
35176
|
this.fileToModulesMap.set(file, fileMappedModules);
|
35142
35177
|
}
|
35143
35178
|
fileMappedModules.add(mod);
|
@@ -35149,10 +35184,10 @@ var EnvironmentModuleGraph = class {
|
|
35149
35184
|
return modPromise;
|
35150
35185
|
}
|
35151
35186
|
createFileOnlyEntry(file) {
|
35152
|
-
file = normalizePath
|
35187
|
+
file = normalizePath(file);
|
35153
35188
|
let fileMappedModules = this.fileToModulesMap.get(file);
|
35154
35189
|
if (!fileMappedModules) {
|
35155
|
-
fileMappedModules = new Set();
|
35190
|
+
fileMappedModules = /* @__PURE__ */ new Set();
|
35156
35191
|
this.fileToModulesMap.set(file, fileMappedModules);
|
35157
35192
|
}
|
35158
35193
|
const url$6 = `${FS_PREFIX}${file}`;
|
@@ -35245,12 +35280,12 @@ async function warmupFile(server, environment, file) {
|
|
35245
35280
|
function htmlFileToUrl(file, root) {
|
35246
35281
|
const url$6 = path.relative(root, file);
|
35247
35282
|
if (url$6[0] === ".") return;
|
35248
|
-
return "/" + normalizePath
|
35283
|
+
return "/" + normalizePath(url$6);
|
35249
35284
|
}
|
35250
35285
|
function fileToUrl(file, root) {
|
35251
35286
|
const url$6 = path.relative(root, file);
|
35252
|
-
if (url$6[0] === ".") return path.posix.join(FS_PREFIX, normalizePath
|
35253
|
-
return "/" + normalizePath
|
35287
|
+
if (url$6[0] === ".") return path.posix.join(FS_PREFIX, normalizePath(file));
|
35288
|
+
return "/" + normalizePath(url$6);
|
35254
35289
|
}
|
35255
35290
|
async function mapFiles(files, root) {
|
35256
35291
|
if (!files.length) return [];
|
@@ -35312,7 +35347,7 @@ var DevEnvironment = class extends BaseEnvironment {
|
|
35312
35347
|
if (!options$1) throw new Error(`Environment "${name}" is not defined in the config.`);
|
35313
35348
|
if (context.options) options$1 = mergeConfig(options$1, context.options);
|
35314
35349
|
super(name, config$2, options$1);
|
35315
|
-
this._pendingRequests = new Map();
|
35350
|
+
this._pendingRequests = /* @__PURE__ */ new Map();
|
35316
35351
|
this.moduleGraph = new EnvironmentModuleGraph(name, (url$6) => this.pluginContainer.resolveId(url$6, void 0));
|
35317
35352
|
this._crawlEndFinder = setupOnCrawlEnd();
|
35318
35353
|
this._remoteRunnerOptions = context.remoteRunner ?? {};
|
@@ -35355,7 +35390,7 @@ var DevEnvironment = class extends BaseEnvironment {
|
|
35355
35390
|
});
|
35356
35391
|
}
|
35357
35392
|
async reloadModule(module$1) {
|
35358
|
-
if (this.config.server.hmr !== false && module$1.file) updateModules(this, module$1.file, [module$1],
|
35393
|
+
if (this.config.server.hmr !== false && module$1.file) updateModules(this, module$1.file, [module$1], monotonicDateNow());
|
35359
35394
|
}
|
35360
35395
|
transformRequest(url$6) {
|
35361
35396
|
return transformRequest(this, url$6);
|
@@ -35412,8 +35447,8 @@ function invalidateModule(environment, m$2) {
|
|
35412
35447
|
}
|
35413
35448
|
const callCrawlEndIfIdleAfterMs = 50;
|
35414
35449
|
function setupOnCrawlEnd() {
|
35415
|
-
const registeredIds = new Set();
|
35416
|
-
const seenIds = new Set();
|
35450
|
+
const registeredIds = /* @__PURE__ */ new Set();
|
35451
|
+
const seenIds = /* @__PURE__ */ new Set();
|
35417
35452
|
const onCrawlEndPromiseWithResolvers = promiseWithResolvers();
|
35418
35453
|
let timeoutHandle;
|
35419
35454
|
let cancelled = false;
|
@@ -35501,7 +35536,7 @@ function getChunkSize(chunk, enc) {
|
|
35501
35536
|
* @param {import('./index.d.mts').Options} [options]
|
35502
35537
|
* @returns {import('./index.d.mts').Middleware}
|
35503
35538
|
*/
|
35504
|
-
function build_default({ threshold = 1024, level = -1, brotli = false, gzip: gzip$1 = true, mimes: mimes$1 = MIMES } = {}) {
|
35539
|
+
function build_default$1({ threshold = 1024, level = -1, brotli = false, gzip: gzip$1 = true, mimes: mimes$1 = MIMES } = {}) {
|
35505
35540
|
const brotliOpts = typeof brotli === "object" && brotli || {};
|
35506
35541
|
const gzipOpts = typeof gzip$1 === "object" && gzip$1 || {};
|
35507
35542
|
if (!zlib.createBrotliCompress) brotli = false;
|
@@ -35633,22 +35668,22 @@ async function preview(inlineConfig = {}) {
|
|
35633
35668
|
}
|
35634
35669
|
};
|
35635
35670
|
setupSIGTERMListener(closeServerAndExit);
|
35671
|
+
const { cors } = config$2.preview;
|
35672
|
+
if (cors !== false) app.use((0, import_lib.default)(typeof cors === "boolean" ? {} : cors));
|
35673
|
+
const { allowedHosts } = config$2.preview;
|
35674
|
+
if (allowedHosts !== true && !config$2.preview.https) app.use(hostValidationMiddleware(allowedHosts, true));
|
35636
35675
|
const configurePreviewServerContext = new BasicMinimalPluginContext({
|
35637
35676
|
...basePluginContextMeta,
|
35638
35677
|
watchMode: false
|
35639
35678
|
}, config$2.logger);
|
35640
35679
|
const postHooks = [];
|
35641
35680
|
for (const hook of config$2.getSortedPluginHooks("configurePreviewServer")) postHooks.push(await hook.call(configurePreviewServerContext, server));
|
35642
|
-
const { cors } = config$2.preview;
|
35643
|
-
if (cors !== false) app.use((0, import_lib.default)(typeof cors === "boolean" ? {} : cors));
|
35644
|
-
const { allowedHosts } = config$2.preview;
|
35645
|
-
if (allowedHosts !== true && !config$2.preview.https) app.use(hostValidationMiddleware(allowedHosts, true));
|
35646
35681
|
const { proxy } = config$2.preview;
|
35647
35682
|
if (proxy) app.use(proxyMiddleware(httpServer, proxy, config$2));
|
35648
|
-
app.use(build_default());
|
35683
|
+
app.use(build_default$1());
|
35649
35684
|
if (config$2.base !== "/") app.use(baseMiddleware(config$2.rawBase, false));
|
35650
35685
|
const headers = config$2.preview.headers;
|
35651
|
-
const viteAssetMiddleware = (...args) => build_default
|
35686
|
+
const viteAssetMiddleware = (...args) => build_default(distDir, {
|
35652
35687
|
etag: true,
|
35653
35688
|
dev: true,
|
35654
35689
|
extensions: [],
|
@@ -35834,7 +35869,7 @@ const configDefaults = Object.freeze({
|
|
35834
35869
|
function resolveDevEnvironmentOptions(dev, environmentName, consumer, preTransformRequest$1) {
|
35835
35870
|
const resolved = mergeWithDefaults({
|
35836
35871
|
...configDefaults.dev,
|
35837
|
-
sourcemapIgnoreList: isInNodeModules
|
35872
|
+
sourcemapIgnoreList: isInNodeModules,
|
35838
35873
|
preTransformRequests: preTransformRequest$1 ?? consumer === "client",
|
35839
35874
|
createEnvironment: environmentName === "client" ? defaultCreateClientDevEnvironment : defaultCreateDevEnvironment,
|
35840
35875
|
recoverable: consumer === "client",
|
@@ -35897,10 +35932,10 @@ function checkBadCharactersInPath(name, path$13, logger) {
|
|
35897
35932
|
}
|
35898
35933
|
const clientAlias = [{
|
35899
35934
|
find: /^\/?@vite\/env/,
|
35900
|
-
replacement: path.posix.join(FS_PREFIX, normalizePath
|
35935
|
+
replacement: path.posix.join(FS_PREFIX, normalizePath(ENV_ENTRY))
|
35901
35936
|
}, {
|
35902
35937
|
find: /^\/?@vite\/client/,
|
35903
|
-
replacement: path.posix.join(FS_PREFIX, normalizePath
|
35938
|
+
replacement: path.posix.join(FS_PREFIX, normalizePath(CLIENT_ENTRY))
|
35904
35939
|
}];
|
35905
35940
|
/**
|
35906
35941
|
* alias and preserveSymlinks are not per-environment options, but they are
|
@@ -35941,7 +35976,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
35941
35976
|
let configFileDependencies = [];
|
35942
35977
|
let mode = inlineConfig.mode || defaultMode;
|
35943
35978
|
const isNodeEnvSet = !!process.env.NODE_ENV;
|
35944
|
-
const packageCache = new Map();
|
35979
|
+
const packageCache = /* @__PURE__ */ new Map();
|
35945
35980
|
if (!isNodeEnvSet) process.env.NODE_ENV = defaultNodeEnv;
|
35946
35981
|
const configEnv = {
|
35947
35982
|
mode,
|
@@ -35991,7 +36026,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
35991
36026
|
allowClearScreen: config$2.clearScreen,
|
35992
36027
|
customLogger: config$2.customLogger
|
35993
36028
|
});
|
35994
|
-
const resolvedRoot = normalizePath
|
36029
|
+
const resolvedRoot = normalizePath(config$2.root ? path.resolve(config$2.root) : process.cwd());
|
35995
36030
|
checkBadCharactersInPath("The project root", resolvedRoot, logger);
|
35996
36031
|
const configEnvironmentsClient = config$2.environments.client;
|
35997
36032
|
configEnvironmentsClient.dev ??= {};
|
@@ -36062,7 +36097,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
36062
36097
|
};
|
36063
36098
|
const ssr = resolveSSROptions(patchedConfigSsr, resolvedDefaultResolve.preserveSymlinks);
|
36064
36099
|
let envDir = config$2.envFile === false ? false : config$2.envDir;
|
36065
|
-
if (envDir !== false) envDir = config$2.envDir ? normalizePath
|
36100
|
+
if (envDir !== false) envDir = config$2.envDir ? normalizePath(path.resolve(resolvedRoot, config$2.envDir)) : resolvedRoot;
|
36066
36101
|
const userEnv = loadEnv(mode, envDir, resolveEnvPrefix(config$2));
|
36067
36102
|
const userNodeEnv = process.env.VITE_USER_NODE_ENV;
|
36068
36103
|
if (!isNodeEnvSet && userNodeEnv) if (userNodeEnv === "development") process.env.NODE_ENV = "development";
|
@@ -36071,10 +36106,10 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
36071
36106
|
const relativeBaseShortcut = config$2.base === "" || config$2.base === "./";
|
36072
36107
|
const resolvedBase = relativeBaseShortcut ? !isBuild || config$2.build?.ssr ? "/" : "./" : resolveBaseUrl(config$2.base, isBuild, logger);
|
36073
36108
|
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
|
36109
|
+
const cacheDir = normalizePath(config$2.cacheDir ? path.resolve(resolvedRoot, config$2.cacheDir) : pkgDir ? path.join(pkgDir, `node_modules/.vite`) : path.join(resolvedRoot, `.vite`));
|
36110
|
+
const assetsFilter = config$2.assetsInclude && (!Array.isArray(config$2.assetsInclude) || config$2.assetsInclude.length) ? createFilter(config$2.assetsInclude) : () => false;
|
36076
36111
|
const { publicDir } = config$2;
|
36077
|
-
const resolvedPublicDir = publicDir !== false && publicDir !== "" ? normalizePath
|
36112
|
+
const resolvedPublicDir = publicDir !== false && publicDir !== "" ? normalizePath(path.resolve(resolvedRoot, typeof publicDir === "string" ? publicDir : configDefaults.publicDir)) : "";
|
36078
36113
|
const server = resolveServerOptions(resolvedRoot, config$2.server, logger);
|
36079
36114
|
const builder = resolveBuilderOptions(config$2.builder);
|
36080
36115
|
const BASE_URL = resolvedBase;
|
@@ -36106,6 +36141,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
36106
36141
|
bundleChain
|
36107
36142
|
};
|
36108
36143
|
workerResolved.plugins = await resolvePlugins(workerResolved, workerPrePlugins, workerNormalPlugins, workerPostPlugins);
|
36144
|
+
await Promise.all(createPluginHookUtils(workerResolved.plugins).getSortedPluginHooks("configResolved").map((hook) => hook.call(resolvedConfigContext, workerResolved)));
|
36109
36145
|
workerResolved.environments = {
|
36110
36146
|
...workerResolved.environments,
|
36111
36147
|
client: {
|
@@ -36113,7 +36149,6 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
36113
36149
|
plugins: await resolveEnvironmentPlugins(new PartialEnvironment("client", workerResolved))
|
36114
36150
|
}
|
36115
36151
|
};
|
36116
|
-
await Promise.all(createPluginHookUtils(workerResolved.plugins).getSortedPluginHooks("configResolved").map((hook) => hook.call(resolvedConfigContext, workerResolved)));
|
36117
36152
|
return workerResolved;
|
36118
36153
|
};
|
36119
36154
|
const resolvedWorkerOptions = {
|
@@ -36127,8 +36162,8 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
36127
36162
|
if (Array.isArray(server.allowedHosts)) server.allowedHosts.push(...additionalAllowedHosts);
|
36128
36163
|
if (Array.isArray(preview$1.allowedHosts)) preview$1.allowedHosts.push(...additionalAllowedHosts);
|
36129
36164
|
resolved = {
|
36130
|
-
configFile: configFile ? normalizePath
|
36131
|
-
configFileDependencies: configFileDependencies.map((name) => normalizePath
|
36165
|
+
configFile: configFile ? normalizePath(configFile) : void 0,
|
36166
|
+
configFileDependencies: configFileDependencies.map((name) => normalizePath(path.resolve(name))),
|
36132
36167
|
inlineConfig,
|
36133
36168
|
root: resolvedRoot,
|
36134
36169
|
base,
|
@@ -36192,7 +36227,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
36192
36227
|
nocase: true,
|
36193
36228
|
dot: true
|
36194
36229
|
}),
|
36195
|
-
safeModulePaths: new Set(),
|
36230
|
+
safeModulePaths: /* @__PURE__ */ new Set(),
|
36196
36231
|
[SYMBOL_RESOLVED_CONFIG]: true
|
36197
36232
|
};
|
36198
36233
|
resolved = {
|
@@ -36204,8 +36239,8 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
36204
36239
|
patchPlugins?.(resolvedPlugins);
|
36205
36240
|
resolved.plugins = resolvedPlugins;
|
36206
36241
|
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
36242
|
await Promise.all(resolved.getSortedPluginHooks("configResolved").map((hook) => hook.call(resolvedConfigContext, resolved)));
|
36243
|
+
for (const name of Object.keys(resolved.environments)) resolved.environments[name].plugins = await resolveEnvironmentPlugins(new PartialEnvironment(name, resolved));
|
36209
36244
|
optimizeDepsDisabledBackwardCompatibility(resolved, resolved.optimizeDeps);
|
36210
36245
|
optimizeDepsDisabledBackwardCompatibility(resolved, resolved.ssr.optimizeDeps, "ssr.");
|
36211
36246
|
if (resolved.environments.ssr) resolved.environments.ssr.build.emitAssets = resolved.build.ssrEmitAssets || resolved.build.emitAssets;
|
@@ -36232,7 +36267,7 @@ assetFileNames isn't equal for every build.rollupOptions.output. A single patter
|
|
36232
36267
|
(!) Experimental legacy.buildSsrCjsExternalHeuristics and ssr.format were be removed in Vite 5.
|
36233
36268
|
The only SSR Output format is ESM. Find more information at https://github.com/vitejs/vite/discussions/13816.
|
36234
36269
|
`));
|
36235
|
-
const resolvedBuildOutDir = normalizePath
|
36270
|
+
const resolvedBuildOutDir = normalizePath(path.resolve(resolved.root, resolved.build.outDir));
|
36236
36271
|
if (isParentDirectory(resolvedBuildOutDir, resolved.root) || resolvedBuildOutDir === resolved.root) resolved.logger.warn(import_picocolors.default.yellow(`
|
36237
36272
|
(!) 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
36273
|
`));
|
@@ -36298,9 +36333,9 @@ async function loadConfigFromFile(configEnv, configFile, configRoot = process.cw
|
|
36298
36333
|
const { configExport, dependencies } = await resolver(resolvedPath);
|
36299
36334
|
debug?.(`config file loaded in ${getTime()}`);
|
36300
36335
|
const config$2 = await (typeof configExport === "function" ? configExport(configEnv) : configExport);
|
36301
|
-
if (!isObject
|
36336
|
+
if (!isObject(config$2)) throw new Error(`config must export or return an object.`);
|
36302
36337
|
return {
|
36303
|
-
path: normalizePath
|
36338
|
+
path: normalizePath(resolvedPath),
|
36304
36339
|
config: config$2,
|
36305
36340
|
dependencies
|
36306
36341
|
};
|
@@ -36361,7 +36396,7 @@ async function bundleConfigFile(fileName, isESM) {
|
|
36361
36396
|
plugins: [{
|
36362
36397
|
name: "externalize-deps",
|
36363
36398
|
setup(build$3) {
|
36364
|
-
const packageCache = new Map();
|
36399
|
+
const packageCache = /* @__PURE__ */ new Map();
|
36365
36400
|
const resolveByViteResolver = (id, importer, isRequire$1) => {
|
36366
36401
|
return tryNodeResolve(id, importer, {
|
36367
36402
|
root: path.dirname(fileName),
|
@@ -36514,4 +36549,4 @@ function optimizeDepsDisabledBackwardCompatibility(resolved, optimizeDeps$1, opt
|
|
36514
36549
|
}
|
36515
36550
|
|
36516
36551
|
//#endregion
|
36517
|
-
export { BuildEnvironment, DevEnvironment, _createServer, addManuallyIncludedOptimizeDeps, addOptimizedDepInfo, build$1 as build, buildEnvironmentOptionsDefaults, buildErrorMessage, builderOptionsDefaults, cleanupDepsCacheStaleDirs, createBuilder, createFilter
|
36552
|
+
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 };
|