vite 7.1.8 → 7.1.10
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.
Potentially problematic release.
This version of vite might be problematic. Click here for more details.
- package/dist/client/client.mjs +20 -7
- package/dist/node/chunks/{dep-CuuNgwUk.js → dep-B0GuR2De.js} +229 -375
- package/dist/node/chunks/{dep-DrqJEUj9.js → dep-B0biTXWL.js} +12 -23
- package/dist/node/chunks/{dep-kz7ELjGS.js → dep-B6cO9KC8.js} +1 -1
- package/dist/node/chunks/{dep-CCSnTAeo.js → dep-BRReGxEs.js} +3 -6
- package/dist/node/chunks/{dep-Cmz3oSY2.js → dep-BhuufcWm.js} +1 -1
- package/dist/node/chunks/{dep-0_1MO8LM.js → dep-Cl2Q94Oy.js} +1 -1
- package/dist/node/chunks/dep-D5ktuZSi.js +4 -0
- package/dist/node/chunks/{dep-BABVH4H3.js → dep-F8pfeHm9.js} +1 -1
- package/dist/node/cli.js +10 -13
- package/dist/node/index.d.ts +3 -3
- package/dist/node/index.js +1 -1
- package/dist/node/module-runner.js +3 -4
- package/package.json +6 -6
- package/dist/node/chunks/dep-CxADCNV7.js +0 -4
|
@@ -123,8 +123,7 @@ function decodeInteger(reader, relative$3) {
|
|
|
123
123
|
let shift = 0;
|
|
124
124
|
let integer = 0;
|
|
125
125
|
do {
|
|
126
|
-
|
|
127
|
-
integer = charToInt[c];
|
|
126
|
+
integer = charToInt[reader.next()];
|
|
128
127
|
value$1 |= (integer & 31) << shift;
|
|
129
128
|
shift += 5;
|
|
130
129
|
} while (integer & 32);
|
|
@@ -745,10 +744,7 @@ function getIndex(arr, index) {
|
|
|
745
744
|
}
|
|
746
745
|
function getColumnIndex(line, genColumn) {
|
|
747
746
|
let index = line.length;
|
|
748
|
-
for (let i$1 = index - 1; i$1 >= 0; index = i$1--)
|
|
749
|
-
const current = line[i$1];
|
|
750
|
-
if (genColumn >= current[COLUMN]) break;
|
|
751
|
-
}
|
|
747
|
+
for (let i$1 = index - 1; i$1 >= 0; index = i$1--) if (genColumn >= line[i$1][COLUMN]) break;
|
|
752
748
|
return index;
|
|
753
749
|
}
|
|
754
750
|
function insert(array, index, value$1) {
|
|
@@ -848,7 +844,7 @@ Did you specify these with the most recent transformation maps first?`);
|
|
|
848
844
|
function build$2(map$1, loader$1, importer, importerDepth) {
|
|
849
845
|
const { resolvedSources, sourcesContent, ignoreList } = map$1;
|
|
850
846
|
const depth = importerDepth + 1;
|
|
851
|
-
|
|
847
|
+
return MapSource(map$1, resolvedSources.map((sourceFile, i$1) => {
|
|
852
848
|
const ctx = {
|
|
853
849
|
importer,
|
|
854
850
|
depth,
|
|
@@ -859,11 +855,8 @@ function build$2(map$1, loader$1, importer, importerDepth) {
|
|
|
859
855
|
const sourceMap = loader$1(ctx.source, ctx);
|
|
860
856
|
const { source, content, ignore } = ctx;
|
|
861
857
|
if (sourceMap) return build$2(new TraceMap(sourceMap, source), loader$1, source, depth);
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
return OriginalSource(source, sourceContent, ignored);
|
|
865
|
-
});
|
|
866
|
-
return MapSource(map$1, children);
|
|
858
|
+
return OriginalSource(source, content !== void 0 ? content : sourcesContent ? sourcesContent[i$1] : null, ignore !== void 0 ? ignore : ignoreList ? ignoreList.includes(i$1) : false);
|
|
859
|
+
}));
|
|
867
860
|
}
|
|
868
861
|
var SourceMap$1 = class {
|
|
869
862
|
constructor(map$1, options$1) {
|
|
@@ -886,8 +879,7 @@ function remapping(input, loader$1, options$1) {
|
|
|
886
879
|
excludeContent: !!options$1,
|
|
887
880
|
decodedMappings: false
|
|
888
881
|
};
|
|
889
|
-
|
|
890
|
-
return new SourceMap$1(traceMappings(tree), opts);
|
|
882
|
+
return new SourceMap$1(traceMappings(buildSourceMapTree(input, loader$1)), opts);
|
|
891
883
|
}
|
|
892
884
|
|
|
893
885
|
//#endregion
|
|
@@ -1684,8 +1676,7 @@ function getMatcherString$1(id, resolutionBase) {
|
|
|
1684
1676
|
const createFilter$2 = function createFilter$3(include, exclude, options$1) {
|
|
1685
1677
|
const resolutionBase = options$1 && options$1.resolve;
|
|
1686
1678
|
const getMatcher = (id) => id instanceof RegExp ? id : { test: (what) => {
|
|
1687
|
-
|
|
1688
|
-
return picomatch(pattern, { dot: true })(what);
|
|
1679
|
+
return picomatch(getMatcherString$1(id, resolutionBase), { dot: true })(what);
|
|
1689
1680
|
} };
|
|
1690
1681
|
const includeMatchers = ensureArray(include).map(getMatcher);
|
|
1691
1682
|
const excludeMatchers = ensureArray(exclude).map(getMatcher);
|
|
@@ -1836,8 +1827,7 @@ function resolvePackageData(pkgName, basedir, preserveSymlinks = false, packageC
|
|
|
1836
1827
|
const pkg = path.join(basedir, "node_modules", pkgName, "package.json");
|
|
1837
1828
|
try {
|
|
1838
1829
|
if (fs.existsSync(pkg)) {
|
|
1839
|
-
const
|
|
1840
|
-
const pkgData = loadPackageData(pkgPath);
|
|
1830
|
+
const pkgData = loadPackageData(preserveSymlinks ? pkg : safeRealpathSync(pkg));
|
|
1841
1831
|
if (packageCache) setRpdCache(packageCache, pkgData, pkgName, basedir, originalBasedir, preserveSymlinks);
|
|
1842
1832
|
return pkgData;
|
|
1843
1833
|
}
|
|
@@ -1878,13 +1868,10 @@ function loadPackageData(pkgPath) {
|
|
|
1878
1868
|
let hasSideEffects;
|
|
1879
1869
|
if (typeof sideEffects === "boolean") hasSideEffects = () => sideEffects;
|
|
1880
1870
|
else if (Array.isArray(sideEffects)) if (sideEffects.length <= 0) hasSideEffects = () => false;
|
|
1881
|
-
else {
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
});
|
|
1886
|
-
hasSideEffects = createFilter(finalPackageSideEffects, null, { resolve: pkgDir });
|
|
1887
|
-
}
|
|
1871
|
+
else hasSideEffects = createFilter(sideEffects.map((sideEffect) => {
|
|
1872
|
+
if (sideEffect.includes("/")) return sideEffect;
|
|
1873
|
+
return `**/${sideEffect}`;
|
|
1874
|
+
}), null, { resolve: pkgDir });
|
|
1888
1875
|
else hasSideEffects = () => null;
|
|
1889
1876
|
const resolvedCache = {};
|
|
1890
1877
|
return {
|
|
@@ -2670,8 +2657,7 @@ function mergeWithDefaultsRecursively(defaults, values) {
|
|
|
2670
2657
|
}
|
|
2671
2658
|
const environmentPathRE = /^environments\.[^.]+$/;
|
|
2672
2659
|
function mergeWithDefaults(defaults, values) {
|
|
2673
|
-
|
|
2674
|
-
return mergeWithDefaultsRecursively(clonedDefaults, values);
|
|
2660
|
+
return mergeWithDefaultsRecursively(deepClone(defaults), values);
|
|
2675
2661
|
}
|
|
2676
2662
|
function mergeConfigRecursively(defaults, overrides, rootPath) {
|
|
2677
2663
|
const merged = { ...defaults };
|
|
@@ -2899,14 +2885,10 @@ const sigtermCallbacks = /* @__PURE__ */ new Set();
|
|
|
2899
2885
|
const parentSigtermCallback = async (signal, exitCode) => {
|
|
2900
2886
|
await Promise.all([...sigtermCallbacks].map((cb) => cb(signal, exitCode)));
|
|
2901
2887
|
};
|
|
2902
|
-
const drain = () => {};
|
|
2903
2888
|
const setupSIGTERMListener = (callback) => {
|
|
2904
2889
|
if (sigtermCallbacks.size === 0) {
|
|
2905
2890
|
process.once("SIGTERM", parentSigtermCallback);
|
|
2906
|
-
if (process.env.CI !== "true")
|
|
2907
|
-
if (!process.stdin.isTTY) process.stdin.on("data", drain);
|
|
2908
|
-
process.stdin.on("end", parentSigtermCallback);
|
|
2909
|
-
}
|
|
2891
|
+
if (process.env.CI !== "true") process.stdin.on("end", parentSigtermCallback);
|
|
2910
2892
|
}
|
|
2911
2893
|
sigtermCallbacks.add(callback);
|
|
2912
2894
|
};
|
|
@@ -2914,10 +2896,7 @@ const teardownSIGTERMListener = (callback) => {
|
|
|
2914
2896
|
sigtermCallbacks.delete(callback);
|
|
2915
2897
|
if (sigtermCallbacks.size === 0) {
|
|
2916
2898
|
process.off("SIGTERM", parentSigtermCallback);
|
|
2917
|
-
if (process.env.CI !== "true")
|
|
2918
|
-
process.stdin.off("data", drain);
|
|
2919
|
-
process.stdin.off("end", parentSigtermCallback);
|
|
2920
|
-
}
|
|
2899
|
+
if (process.env.CI !== "true") process.stdin.off("end", parentSigtermCallback);
|
|
2921
2900
|
}
|
|
2922
2901
|
};
|
|
2923
2902
|
function getServerUrlByHost(resolvedUrls, host) {
|
|
@@ -3203,10 +3182,9 @@ function getLocator(source) {
|
|
|
3203
3182
|
else i$1 = m$2 + 1;
|
|
3204
3183
|
}
|
|
3205
3184
|
const line = i$1 - 1;
|
|
3206
|
-
const column = index - lineOffsets[line];
|
|
3207
3185
|
return {
|
|
3208
3186
|
line,
|
|
3209
|
-
column
|
|
3187
|
+
column: index - lineOffsets[line]
|
|
3210
3188
|
};
|
|
3211
3189
|
};
|
|
3212
3190
|
}
|
|
@@ -4102,15 +4080,13 @@ function getDynamicModuleRegistry(isDynamicRequireModulesEnabled, dynamicRequire
|
|
|
4102
4080
|
if (!isDynamicRequireModulesEnabled) return `export function ${COMMONJS_REQUIRE_EXPORT}(path) {
|
|
4103
4081
|
${FAILED_REQUIRE_ERROR}
|
|
4104
4082
|
}`;
|
|
4105
|
-
|
|
4106
|
-
const dynamicModuleProps = [...dynamicRequireModules.keys()].map((id, index) => `\t\t${JSON.stringify(getVirtualPathForDynamicRequirePath(id, commonDir))}: ${id.endsWith(".json") ? `function () { return json${index}; }` : `require${index}`}`).join(",\n");
|
|
4107
|
-
return `${dynamicModuleImports}
|
|
4083
|
+
return `${[...dynamicRequireModules.values()].map((id, index) => `import ${id.endsWith(".json") ? `json${index}` : `{ __require as require${index} }`} from ${JSON.stringify(id)};`).join("\n")}
|
|
4108
4084
|
|
|
4109
4085
|
var dynamicModules;
|
|
4110
4086
|
|
|
4111
4087
|
function getDynamicModules() {
|
|
4112
4088
|
return dynamicModules || (dynamicModules = {
|
|
4113
|
-
${
|
|
4089
|
+
${[...dynamicRequireModules.keys()].map((id, index) => `\t\t${JSON.stringify(getVirtualPathForDynamicRequirePath(id, commonDir))}: ${id.endsWith(".json") ? `function () { return json${index}; }` : `require${index}`}`).join(",\n")}
|
|
4114
4090
|
});
|
|
4115
4091
|
}
|
|
4116
4092
|
|
|
@@ -4308,8 +4284,7 @@ function getCandidates(resolved, extensions$1) {
|
|
|
4308
4284
|
}
|
|
4309
4285
|
function resolveExtensions(importee, importer, extensions$1) {
|
|
4310
4286
|
if (importee[0] !== "." || !importer) return void 0;
|
|
4311
|
-
const
|
|
4312
|
-
const candidates = getCandidates(resolved, extensions$1);
|
|
4287
|
+
const candidates = getCandidates(resolve$1(dirname$1(importer), importee), extensions$1);
|
|
4313
4288
|
for (let i$1 = 0; i$1 < candidates.length; i$1 += 1) try {
|
|
4314
4289
|
if (statSync(candidates[i$1]).isFile()) return { id: candidates[i$1] };
|
|
4315
4290
|
} catch (err$2) {}
|
|
@@ -4699,13 +4674,12 @@ function getRequireHandlers() {
|
|
|
4699
4674
|
if (exportMode === "module") imports.push(`import { __module as ${moduleName} } from ${JSON.stringify(wrapId$1(id, MODULE_SUFFIX))}`, `var ${exportsName} = ${moduleName}.exports`);
|
|
4700
4675
|
else if (exportMode === "exports") imports.push(`import { __exports as ${exportsName} } from ${JSON.stringify(wrapId$1(id, EXPORTS_SUFFIX))}`);
|
|
4701
4676
|
const requiresBySource = collectSources(requireExpressions);
|
|
4702
|
-
|
|
4677
|
+
processRequireExpressions(imports, await resolveRequireSourcesAndUpdateMeta(id, needsRequireWrapper ? IS_WRAPPED_COMMONJS : !isEsModule, commonjsMeta, Object.keys(requiresBySource).map((source) => {
|
|
4703
4678
|
return {
|
|
4704
4679
|
source,
|
|
4705
4680
|
isConditional: requiresBySource[source].every((require$1) => require$1.isInsideConditional)
|
|
4706
4681
|
};
|
|
4707
|
-
}));
|
|
4708
|
-
processRequireExpressions(imports, requireTargets, requiresBySource, getIgnoreTryCatchRequireStatementMode, magicString);
|
|
4682
|
+
})), requiresBySource, getIgnoreTryCatchRequireStatementMode, magicString);
|
|
4709
4683
|
return imports.length ? `${imports.join(";\n")};\n\n` : "";
|
|
4710
4684
|
}
|
|
4711
4685
|
return {
|
|
@@ -5509,8 +5483,7 @@ const resolve2posix = IS_POSIX ? (dir, filename) => dir ? path.resolve(dir, file
|
|
|
5509
5483
|
function resolveReferencedTSConfigFiles(result, options$1) {
|
|
5510
5484
|
const dir = path.dirname(result.tsconfigFile);
|
|
5511
5485
|
return result.tsconfig.references.map((ref) => {
|
|
5512
|
-
|
|
5513
|
-
return resolve2posix(dir, refPath);
|
|
5486
|
+
return resolve2posix(dir, ref.path.endsWith(".json") ? ref.path : path.join(ref.path, options$1?.configName ?? "tsconfig.json"));
|
|
5514
5487
|
});
|
|
5515
5488
|
}
|
|
5516
5489
|
/**
|
|
@@ -5953,10 +5926,7 @@ async function parseExtends(result, cache$1) {
|
|
|
5953
5926
|
if (!Array.isArray(extending.tsconfig.extends)) resolvedExtends = [resolveExtends(extending.tsconfig.extends, extending.tsconfigFile)];
|
|
5954
5927
|
else resolvedExtends = extending.tsconfig.extends.reverse().map((ex) => resolveExtends(ex, extending.tsconfigFile));
|
|
5955
5928
|
const circularExtends = resolvedExtends.find((tsconfigFile) => extendsPath.includes(tsconfigFile));
|
|
5956
|
-
if (circularExtends) {
|
|
5957
|
-
const circle = extendsPath.concat([circularExtends]).join(" -> ");
|
|
5958
|
-
throw new TSConfckParseError(`Circular dependency in "extends": ${circle}`, "EXTENDS_CIRCULAR", result.tsconfigFile);
|
|
5959
|
-
}
|
|
5929
|
+
if (circularExtends) throw new TSConfckParseError(`Circular dependency in "extends": ${extendsPath.concat([circularExtends]).join(" -> ")}`, "EXTENDS_CIRCULAR", result.tsconfigFile);
|
|
5960
5930
|
extended.splice(pos + 1, 0, ...await Promise.all(resolvedExtends.map((file) => parseFile$1(file, cache$1))));
|
|
5961
5931
|
} else {
|
|
5962
5932
|
extendsPath.splice(-currentBranchDepth);
|
|
@@ -6232,7 +6202,7 @@ var TSConfckCache = class {
|
|
|
6232
6202
|
//#region src/node/plugins/esbuild.ts
|
|
6233
6203
|
var import_picocolors$31 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
6234
6204
|
const debug$17 = createDebugger("vite:esbuild");
|
|
6235
|
-
const IIFE_BEGIN_RE = /(?:const|var)\s+\S+\s*=\s
|
|
6205
|
+
const IIFE_BEGIN_RE = /(?:const|var)\s+\S+\s*=\s*\(?function\([^()]*\)\s*\{\s*"use strict";/;
|
|
6236
6206
|
const validExtensionRE = /\.\w+$/;
|
|
6237
6207
|
const jsxExtensionsRE = /\.(?:j|t)sx\b/;
|
|
6238
6208
|
const defaultEsbuildSupported = {
|
|
@@ -7406,8 +7376,7 @@ function renderAssetUrlInJS(pluginContext, chunk, opts, code) {
|
|
|
7406
7376
|
const [full, referenceId, postfix = ""] = match;
|
|
7407
7377
|
const file = pluginContext.getFileName(referenceId);
|
|
7408
7378
|
chunk.viteMetadata.importedAssets.add(cleanUrl(file));
|
|
7409
|
-
const
|
|
7410
|
-
const replacement = toOutputFilePathInJS(environment, filename, "asset", chunk.fileName, "js", toRelativeRuntime);
|
|
7379
|
+
const replacement = toOutputFilePathInJS(environment, file + postfix, "asset", chunk.fileName, "js", toRelativeRuntime);
|
|
7411
7380
|
const replacementString = typeof replacement === "string" ? JSON.stringify(encodeURIPath(replacement)).slice(1, -1) : `"+${replacement.runtime}+"`;
|
|
7412
7381
|
s$2.update(match.index, match.index + full.length, replacementString);
|
|
7413
7382
|
}
|
|
@@ -7416,8 +7385,7 @@ function renderAssetUrlInJS(pluginContext, chunk, opts, code) {
|
|
|
7416
7385
|
while (match = publicAssetUrlRE.exec(code)) {
|
|
7417
7386
|
s$2 ||= new MagicString(code);
|
|
7418
7387
|
const [full, hash$1] = match;
|
|
7419
|
-
const
|
|
7420
|
-
const replacement = toOutputFilePathInJS(environment, publicUrl, "public", chunk.fileName, "js", toRelativeRuntime);
|
|
7388
|
+
const replacement = toOutputFilePathInJS(environment, publicAssetUrlMap.get(hash$1).slice(1), "public", chunk.fileName, "js", toRelativeRuntime);
|
|
7421
7389
|
const replacementString = typeof replacement === "string" ? JSON.stringify(encodeURIPath(replacement)).slice(1, -1) : `"+${replacement.runtime}+"`;
|
|
7422
7390
|
s$2.update(match.index, match.index + full.length, replacementString);
|
|
7423
7391
|
}
|
|
@@ -7503,8 +7471,7 @@ async function fileToDevUrl(environment, id, skipBase = false) {
|
|
|
7503
7471
|
const publicFile = checkPublicFile(id, config$2);
|
|
7504
7472
|
if (inlineRE$3.test(id)) {
|
|
7505
7473
|
const file = publicFile || cleanUrl(id);
|
|
7506
|
-
|
|
7507
|
-
return assetToDataURL(environment, file, content);
|
|
7474
|
+
return assetToDataURL(environment, file, await fsp.readFile(file));
|
|
7508
7475
|
}
|
|
7509
7476
|
const cleanedId = cleanUrl(id);
|
|
7510
7477
|
if (cleanedId.endsWith(".svg")) {
|
|
@@ -7517,8 +7484,7 @@ async function fileToDevUrl(environment, id, skipBase = false) {
|
|
|
7517
7484
|
else if (id.startsWith(withTrailingSlash(config$2.root))) rtn = "/" + path.posix.relative(config$2.root, id);
|
|
7518
7485
|
else rtn = path.posix.join(FS_PREFIX, id);
|
|
7519
7486
|
if (skipBase) return rtn;
|
|
7520
|
-
|
|
7521
|
-
return joinUrlSegments(base, removeLeadingSlash(rtn));
|
|
7487
|
+
return joinUrlSegments(joinUrlSegments(config$2.server.origin ?? "", config$2.decodedBase), removeLeadingSlash(rtn));
|
|
7522
7488
|
}
|
|
7523
7489
|
function getPublicAssetFilename(hash$1, config$2) {
|
|
7524
7490
|
return publicAssetUrlCache.get(config$2)?.get(hash$1);
|
|
@@ -7577,8 +7543,7 @@ async function fileToBuiltUrl(pluginContext, id, skipPublicCheck = false, forceI
|
|
|
7577
7543
|
async function urlToBuiltUrl(pluginContext, url$3, importer, forceInline) {
|
|
7578
7544
|
const topLevelConfig = pluginContext.environment.getTopLevelConfig();
|
|
7579
7545
|
if (checkPublicFile(url$3, topLevelConfig)) return publicFileToBuiltUrl(url$3, topLevelConfig);
|
|
7580
|
-
|
|
7581
|
-
return fileToBuiltUrl(pluginContext, file, true, forceInline);
|
|
7546
|
+
return fileToBuiltUrl(pluginContext, normalizePath(url$3[0] === "/" ? path.join(topLevelConfig.root, url$3) : path.join(path.dirname(importer), url$3)), true, forceInline);
|
|
7582
7547
|
}
|
|
7583
7548
|
function shouldInline(environment, file, id, content, buildPluginContext, forceInline) {
|
|
7584
7549
|
if (noInlineRE.test(id)) return false;
|
|
@@ -7692,8 +7657,7 @@ function manifestPlugin() {
|
|
|
7692
7657
|
if (chunk.type === "chunk") manifest[getChunkName(chunk)] = createChunk(chunk);
|
|
7693
7658
|
else if (chunk.type === "asset" && chunk.names.length > 0) {
|
|
7694
7659
|
const src = chunk.originalFileNames.length > 0 ? chunk.originalFileNames[0] : `_${path.basename(chunk.fileName)}`;
|
|
7695
|
-
const
|
|
7696
|
-
const asset = createAsset(chunk, src, isEntry);
|
|
7660
|
+
const asset = createAsset(chunk, src, entryCssAssetFileNames.has(chunk.fileName));
|
|
7697
7661
|
const file$1 = manifest[src]?.file;
|
|
7698
7662
|
if (!(file$1 && endsWithJSRE.test(file$1))) manifest[src] = asset;
|
|
7699
7663
|
for (const originalFileName of chunk.originalFileNames.slice(1)) {
|
|
@@ -7980,7 +7944,7 @@ var require_convert_source_map = /* @__PURE__ */ __commonJS({ "../../node_module
|
|
|
7980
7944
|
}) });
|
|
7981
7945
|
|
|
7982
7946
|
//#endregion
|
|
7983
|
-
//#region ../../node_modules/.pnpm/@rolldown+pluginutils@1.0.0-beta.
|
|
7947
|
+
//#region ../../node_modules/.pnpm/@rolldown+pluginutils@1.0.0-beta.43/node_modules/@rolldown/pluginutils/dist/index.mjs
|
|
7984
7948
|
/**
|
|
7985
7949
|
* Constructs a RegExp that matches the exact string specified.
|
|
7986
7950
|
*
|
|
@@ -8261,8 +8225,7 @@ var require_src$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/lilco
|
|
|
8261
8225
|
const loaderKey = path$11.extname(searchPlace) || "noExt";
|
|
8262
8226
|
const loader$1 = loaders[loaderKey];
|
|
8263
8227
|
if (searchPlace === "package.json") {
|
|
8264
|
-
const
|
|
8265
|
-
const maybeConfig = getPackageProp(packageProp, pkg);
|
|
8228
|
+
const maybeConfig = getPackageProp(packageProp, await loader$1(filepath, content));
|
|
8266
8229
|
if (maybeConfig != null) {
|
|
8267
8230
|
result.config = maybeConfig;
|
|
8268
8231
|
result.filepath = filepath;
|
|
@@ -8298,13 +8261,10 @@ var require_src$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/lilco
|
|
|
8298
8261
|
const loader$1 = loaders[loaderKey];
|
|
8299
8262
|
validateLoader(loader$1, loaderKey);
|
|
8300
8263
|
const content = String(await fsReadFileAsync(absPath));
|
|
8301
|
-
if (base === "package.json") {
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
filepath: absPath
|
|
8306
|
-
}));
|
|
8307
|
-
}
|
|
8264
|
+
if (base === "package.json") return emplace(loadCache, absPath, transform$2({
|
|
8265
|
+
config: getPackageProp(packageProp, await loader$1(absPath, content)),
|
|
8266
|
+
filepath: absPath
|
|
8267
|
+
}));
|
|
8308
8268
|
/** @type {import('./index').LilconfigResult} */
|
|
8309
8269
|
const result = {
|
|
8310
8270
|
config: null,
|
|
@@ -8373,8 +8333,7 @@ var require_src$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/lilco
|
|
|
8373
8333
|
const loader$1 = loaders[loaderKey];
|
|
8374
8334
|
const content = String(fs$11.readFileSync(filepath));
|
|
8375
8335
|
if (searchPlace === "package.json") {
|
|
8376
|
-
const
|
|
8377
|
-
const maybeConfig = getPackageProp(packageProp, pkg);
|
|
8336
|
+
const maybeConfig = getPackageProp(packageProp, loader$1(filepath, content));
|
|
8378
8337
|
if (maybeConfig != null) {
|
|
8379
8338
|
result.config = maybeConfig;
|
|
8380
8339
|
result.filepath = filepath;
|
|
@@ -8410,13 +8369,10 @@ var require_src$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/lilco
|
|
|
8410
8369
|
const loader$1 = loaders[loaderKey];
|
|
8411
8370
|
validateLoader(loader$1, loaderKey);
|
|
8412
8371
|
const content = String(fs$11.readFileSync(absPath));
|
|
8413
|
-
if (base === "package.json") {
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
filepath: absPath
|
|
8418
|
-
});
|
|
8419
|
-
}
|
|
8372
|
+
if (base === "package.json") return transform$2({
|
|
8373
|
+
config: getPackageProp(packageProp, loader$1(absPath, content)),
|
|
8374
|
+
filepath: absPath
|
|
8375
|
+
});
|
|
8420
8376
|
const result = {
|
|
8421
8377
|
config: null,
|
|
8422
8378
|
filepath: absPath
|
|
@@ -8451,8 +8407,8 @@ var require_src$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/lilco
|
|
|
8451
8407
|
}) });
|
|
8452
8408
|
|
|
8453
8409
|
//#endregion
|
|
8454
|
-
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.
|
|
8455
|
-
var require_req = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.
|
|
8410
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_yaml@2.8.1/node_modules/postcss-load-config/src/req.js
|
|
8411
|
+
var require_req = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_yaml@2.8.1/node_modules/postcss-load-config/src/req.js": ((exports, module) => {
|
|
8456
8412
|
const { createRequire: createRequire$2 } = __require("node:module");
|
|
8457
8413
|
const { fileURLToPath: fileURLToPath$1, pathToFileURL: pathToFileURL$1 } = __require("node:url");
|
|
8458
8414
|
const TS_EXT_RE = /\.[mc]?ts$/;
|
|
@@ -8494,8 +8450,8 @@ var require_req = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss
|
|
|
8494
8450
|
}) });
|
|
8495
8451
|
|
|
8496
8452
|
//#endregion
|
|
8497
|
-
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.
|
|
8498
|
-
var require_options = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.
|
|
8453
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_yaml@2.8.1/node_modules/postcss-load-config/src/options.js
|
|
8454
|
+
var require_options = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_yaml@2.8.1/node_modules/postcss-load-config/src/options.js": ((exports, module) => {
|
|
8499
8455
|
const req$2 = require_req();
|
|
8500
8456
|
/**
|
|
8501
8457
|
* Load Options
|
|
@@ -8529,8 +8485,8 @@ var require_options = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/pos
|
|
|
8529
8485
|
}) });
|
|
8530
8486
|
|
|
8531
8487
|
//#endregion
|
|
8532
|
-
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.
|
|
8533
|
-
var require_plugins = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.
|
|
8488
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_yaml@2.8.1/node_modules/postcss-load-config/src/plugins.js
|
|
8489
|
+
var require_plugins = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_yaml@2.8.1/node_modules/postcss-load-config/src/plugins.js": ((exports, module) => {
|
|
8534
8490
|
const req$1 = require_req();
|
|
8535
8491
|
/**
|
|
8536
8492
|
* Plugin Loader
|
|
@@ -8584,8 +8540,8 @@ var require_plugins = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/pos
|
|
|
8584
8540
|
}) });
|
|
8585
8541
|
|
|
8586
8542
|
//#endregion
|
|
8587
|
-
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.
|
|
8588
|
-
var require_src = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.
|
|
8543
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_yaml@2.8.1/node_modules/postcss-load-config/src/index.js
|
|
8544
|
+
var require_src = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_yaml@2.8.1/node_modules/postcss-load-config/src/index.js": ((exports, module) => {
|
|
8589
8545
|
const { resolve: resolve$2 } = __require("node:path");
|
|
8590
8546
|
const config$1 = require_src$1();
|
|
8591
8547
|
const loadOptions = require_options();
|
|
@@ -8950,11 +8906,9 @@ function clearImports(imports) {
|
|
|
8950
8906
|
}
|
|
8951
8907
|
function getImportNames(cleanedImports) {
|
|
8952
8908
|
const topLevelImports = cleanedImports.replace(/{[^}]*}/, "");
|
|
8953
|
-
const namespacedImport = topLevelImports.match(/\* as \s*(\S*)/)?.[1];
|
|
8954
|
-
const defaultImport = topLevelImports.split(",").find((index) => !/[*{}]/.test(index))?.trim() || void 0;
|
|
8955
8909
|
return {
|
|
8956
|
-
namespacedImport,
|
|
8957
|
-
defaultImport
|
|
8910
|
+
namespacedImport: topLevelImports.match(/\* as \s*(\S*)/)?.[1],
|
|
8911
|
+
defaultImport: topLevelImports.split(",").find((index) => !/[*{}]/.test(index))?.trim() || void 0
|
|
8958
8912
|
};
|
|
8959
8913
|
}
|
|
8960
8914
|
/**
|
|
@@ -9532,8 +9486,7 @@ var PartialEnvironment = class {
|
|
|
9532
9486
|
return this._topLevelConfig[prop];
|
|
9533
9487
|
} });
|
|
9534
9488
|
const environment = import_picocolors$29.default.dim(`(${this.name})`);
|
|
9535
|
-
const
|
|
9536
|
-
const infoColor = environmentColors[colorIndex || 0];
|
|
9489
|
+
const infoColor = environmentColors[[...this.name].reduce((acc, c) => acc + c.charCodeAt(0), 0) % environmentColors.length || 0];
|
|
9537
9490
|
this.logger = {
|
|
9538
9491
|
get hasWarned() {
|
|
9539
9492
|
return topLevelConfig.logger.hasWarned;
|
|
@@ -10131,8 +10084,7 @@ async function parseImportGlob(code, importer, root, resolveId, logger) {
|
|
|
10131
10084
|
};
|
|
10132
10085
|
const end = findCorrespondingCloseParenthesisPosition(cleanCode, start + match[0].length) + 1;
|
|
10133
10086
|
if (end <= 0) throw err$2("Close parenthesis not found");
|
|
10134
|
-
const
|
|
10135
|
-
const rootAst = (await parseAstAsync(statementCode)).body[0];
|
|
10087
|
+
const rootAst = (await parseAstAsync(code.slice(start, end))).body[0];
|
|
10136
10088
|
if (rootAst.type !== "ExpressionStatement") throw err$2(`Expect CallExpression, got ${rootAst.type}`);
|
|
10137
10089
|
const ast = rootAst.expression;
|
|
10138
10090
|
if (ast.type !== "CallExpression") throw err$2(`Expect CallExpression, got ${ast.type}`);
|
|
@@ -10208,10 +10160,9 @@ async function transformGlobImport(code, id, root, resolveId, restoreQueryExtens
|
|
|
10208
10160
|
if (!matches$2.length) return null;
|
|
10209
10161
|
const s$2 = new MagicString(code);
|
|
10210
10162
|
const staticImports = (await Promise.all(matches$2.map(async ({ globsResolved, isRelative: isRelative$1, options: options$1, index, start, end, onlyKeys, onlyValues }) => {
|
|
10211
|
-
const cwd = getCommonBase(globsResolved) ?? root;
|
|
10212
10163
|
const files = (await glob(globsResolved, {
|
|
10213
10164
|
absolute: true,
|
|
10214
|
-
cwd,
|
|
10165
|
+
cwd: getCommonBase(globsResolved) ?? root,
|
|
10215
10166
|
dot: !!options$1.exhaustive,
|
|
10216
10167
|
expandDirectories: false,
|
|
10217
10168
|
ignore: options$1.exhaustive ? [] : ["**/node_modules/**"]
|
|
@@ -10427,20 +10378,14 @@ function scanImports(environment) {
|
|
|
10427
10378
|
${entries.join("\n")}
|
|
10428
10379
|
|
|
10429
10380
|
`);
|
|
10430
|
-
if (e$1.errors) {
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
e$1.message = prependMessage + msgs.join("\n");
|
|
10436
|
-
} else e$1.message = prependMessage + e$1.message;
|
|
10381
|
+
if (e$1.errors) e$1.message = prependMessage + (await formatMessages(e$1.errors, {
|
|
10382
|
+
kind: "error",
|
|
10383
|
+
color: true
|
|
10384
|
+
})).join("\n");
|
|
10385
|
+
else e$1.message = prependMessage + e$1.message;
|
|
10437
10386
|
throw e$1;
|
|
10438
10387
|
} finally {
|
|
10439
|
-
if (debug$15) {
|
|
10440
|
-
const duration = (performance$1.now() - start).toFixed(2);
|
|
10441
|
-
const depsStr = Object.keys(orderedDependencies(deps)).sort().map((id) => `\n ${import_picocolors$27.default.cyan(id)} -> ${import_picocolors$27.default.dim(deps[id])}`).join("") || import_picocolors$27.default.dim("no dependencies found");
|
|
10442
|
-
debug$15(`Scan completed in ${duration}ms: ${depsStr}`);
|
|
10443
|
-
}
|
|
10388
|
+
if (debug$15) debug$15(`Scan completed in ${(performance$1.now() - start).toFixed(2)}ms: ${Object.keys(orderedDependencies(deps)).sort().map((id) => `\n ${import_picocolors$27.default.cyan(id)} -> ${import_picocolors$27.default.dim(deps[id])}`).join("") || import_picocolors$27.default.dim("no dependencies found")}`);
|
|
10444
10389
|
}
|
|
10445
10390
|
} finally {
|
|
10446
10391
|
context?.dispose().catch((e$1) => {
|
|
@@ -10448,10 +10393,9 @@ function scanImports(environment) {
|
|
|
10448
10393
|
});
|
|
10449
10394
|
}
|
|
10450
10395
|
}
|
|
10451
|
-
const result = scan();
|
|
10452
10396
|
return {
|
|
10453
10397
|
cancel,
|
|
10454
|
-
result:
|
|
10398
|
+
result: scan().then((res) => res ?? {
|
|
10455
10399
|
deps: {},
|
|
10456
10400
|
missing: {}
|
|
10457
10401
|
})
|
|
@@ -10869,8 +10813,7 @@ async function optimizeDeps(config$2, force = config$2.optimizeDeps.force, asCom
|
|
|
10869
10813
|
await addManuallyIncludedOptimizeDeps(environment, deps);
|
|
10870
10814
|
const depsString = depsLogString(Object.keys(deps));
|
|
10871
10815
|
log$4?.(import_picocolors$26.default.green(`Optimizing dependencies:\n ${depsString}`));
|
|
10872
|
-
const
|
|
10873
|
-
const result = await runOptimizeDeps(environment, depsInfo).result;
|
|
10816
|
+
const result = await runOptimizeDeps(environment, toDiscoveredDependencies(environment, deps)).result;
|
|
10874
10817
|
await result.commit();
|
|
10875
10818
|
return result.metadata;
|
|
10876
10819
|
}
|
|
@@ -10879,8 +10822,7 @@ async function optimizeExplicitEnvironmentDeps(environment) {
|
|
|
10879
10822
|
if (cachedMetadata) return cachedMetadata;
|
|
10880
10823
|
const deps = {};
|
|
10881
10824
|
await addManuallyIncludedOptimizeDeps(environment, deps);
|
|
10882
|
-
const
|
|
10883
|
-
const result = await runOptimizeDeps(environment, depsInfo).result;
|
|
10825
|
+
const result = await runOptimizeDeps(environment, toDiscoveredDependencies(environment, deps)).result;
|
|
10884
10826
|
await result.commit();
|
|
10885
10827
|
return result.metadata;
|
|
10886
10828
|
}
|
|
@@ -11087,13 +11029,11 @@ function runOptimizeDeps(environment, depsInfo) {
|
|
|
11087
11029
|
}).catch(async (e$1) => {
|
|
11088
11030
|
if (e$1.errors && e$1.message.includes("The build was canceled")) return cancelledResult;
|
|
11089
11031
|
const prependMessage = import_picocolors$26.default.red("Error during dependency optimization:\n\n");
|
|
11090
|
-
if (e$1.errors) {
|
|
11091
|
-
|
|
11092
|
-
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
e$1.message = prependMessage + msgs.join("\n");
|
|
11096
|
-
} else e$1.message = prependMessage + e$1.message;
|
|
11032
|
+
if (e$1.errors) e$1.message = prependMessage + (await formatMessages(e$1.errors, {
|
|
11033
|
+
kind: "error",
|
|
11034
|
+
color: true
|
|
11035
|
+
})).join("\n");
|
|
11036
|
+
else e$1.message = prependMessage + e$1.message;
|
|
11097
11037
|
throw e$1;
|
|
11098
11038
|
}).finally(() => {
|
|
11099
11039
|
return disposeContext();
|
|
@@ -11298,13 +11238,12 @@ async function extractExportsData(environment, filePath) {
|
|
|
11298
11238
|
const { optimizeDeps: optimizeDeps$1 } = environment.config;
|
|
11299
11239
|
const esbuildOptions = optimizeDeps$1.esbuildOptions ?? {};
|
|
11300
11240
|
if (optimizeDeps$1.extensions?.some((ext) => filePath.endsWith(ext))) {
|
|
11301
|
-
const
|
|
11241
|
+
const [, exports$2, , hasModuleSyntax$1] = parse((await build({
|
|
11302
11242
|
...esbuildOptions,
|
|
11303
11243
|
entryPoints: [filePath],
|
|
11304
11244
|
write: false,
|
|
11305
11245
|
format: "esm"
|
|
11306
|
-
});
|
|
11307
|
-
const [, exports$2, , hasModuleSyntax$1] = parse(result.outputFiles[0].text);
|
|
11246
|
+
})).outputFiles[0].text);
|
|
11308
11247
|
return {
|
|
11309
11248
|
hasModuleSyntax: hasModuleSyntax$1,
|
|
11310
11249
|
exports: exports$2.map((e$1) => e$1.n)
|
|
@@ -11318,8 +11257,7 @@ async function extractExportsData(environment, filePath) {
|
|
|
11318
11257
|
} catch {
|
|
11319
11258
|
const loader$1 = esbuildOptions.loader?.[path.extname(filePath)] || "jsx";
|
|
11320
11259
|
debug$14?.(`Unable to parse: ${filePath}.\n Trying again with a ${loader$1} transform.`);
|
|
11321
|
-
|
|
11322
|
-
parseResult = parse(transformed.code);
|
|
11260
|
+
parseResult = parse((await transformWithEsbuild(entryContent, filePath, { loader: loader$1 }, void 0, environment.config)).code);
|
|
11323
11261
|
usedJsxLoader = true;
|
|
11324
11262
|
}
|
|
11325
11263
|
const [, exports$1, , hasModuleSyntax] = parseResult;
|
|
@@ -11390,7 +11328,7 @@ const lockfilePaths = lockfileFormats.map((l) => l.path);
|
|
|
11390
11328
|
function getConfigHash(environment) {
|
|
11391
11329
|
const { config: config$2 } = environment;
|
|
11392
11330
|
const { optimizeDeps: optimizeDeps$1 } = config$2;
|
|
11393
|
-
|
|
11331
|
+
return getHash(JSON.stringify({
|
|
11394
11332
|
define: !config$2.keepProcessEnv ? process.env.NODE_ENV || config$2.mode : null,
|
|
11395
11333
|
root: config$2.root,
|
|
11396
11334
|
resolve: config$2.resolve,
|
|
@@ -11407,8 +11345,7 @@ function getConfigHash(environment) {
|
|
|
11407
11345
|
}, (_, value$1) => {
|
|
11408
11346
|
if (typeof value$1 === "function" || value$1 instanceof RegExp) return value$1.toString();
|
|
11409
11347
|
return value$1;
|
|
11410
|
-
});
|
|
11411
|
-
return getHash(content);
|
|
11348
|
+
}));
|
|
11412
11349
|
}
|
|
11413
11350
|
function getLockfileHash(environment) {
|
|
11414
11351
|
const lockfilePath = lookupFile(environment.config.root, lockfilePaths);
|
|
@@ -11418,8 +11355,7 @@ function getLockfileHash(environment) {
|
|
|
11418
11355
|
const lockfileFormat = lockfileFormats.find((f$1) => normalizedLockfilePath.endsWith(f$1.path));
|
|
11419
11356
|
if (lockfileFormat.checkPatchesDir) {
|
|
11420
11357
|
const baseDir = lockfilePath.slice(0, -lockfileFormat.path.length);
|
|
11421
|
-
const
|
|
11422
|
-
const stat$4 = tryStatSync(fullPath);
|
|
11358
|
+
const stat$4 = tryStatSync(path.join(baseDir, lockfileFormat.checkPatchesDir));
|
|
11423
11359
|
if (stat$4?.isDirectory()) content += stat$4.mtimeMs.toString();
|
|
11424
11360
|
}
|
|
11425
11361
|
}
|
|
@@ -11604,8 +11540,7 @@ function resolvePlugin(resolveOptions) {
|
|
|
11604
11540
|
return ensureVersionQuery(res, id, options$1, depsOptimizer);
|
|
11605
11541
|
}
|
|
11606
11542
|
if (asSrc && id[0] === "/" && (rootInRoot || !id.startsWith(withTrailingSlash(root)))) {
|
|
11607
|
-
|
|
11608
|
-
if (res = tryFsResolve(fsPath, options$1)) {
|
|
11543
|
+
if (res = tryFsResolve(path.resolve(root, id.slice(1)), options$1)) {
|
|
11609
11544
|
debug$12?.(`[url] ${import_picocolors$25.default.cyan(id)} -> ${import_picocolors$25.default.dim(res)}`);
|
|
11610
11545
|
return ensureVersionQuery(res, id, options$1, depsOptimizer);
|
|
11611
11546
|
}
|
|
@@ -11641,8 +11576,7 @@ function resolvePlugin(resolveOptions) {
|
|
|
11641
11576
|
}
|
|
11642
11577
|
if (isWindows && id[0] === "/") {
|
|
11643
11578
|
const basedir = importer ? path.dirname(importer) : process.cwd();
|
|
11644
|
-
|
|
11645
|
-
if (res = tryFsResolve(fsPath, options$1)) {
|
|
11579
|
+
if (res = tryFsResolve(path.resolve(basedir, id), options$1)) {
|
|
11646
11580
|
debug$12?.(`[drive-relative] ${import_picocolors$25.default.cyan(id)} -> ${import_picocolors$25.default.dim(res)}`);
|
|
11647
11581
|
return ensureVersionQuery(res, id, options$1, depsOptimizer);
|
|
11648
11582
|
}
|
|
@@ -11784,8 +11718,7 @@ function tryCleanFsResolve(file, options$1, tryIndex = true, skipPackageJson = f
|
|
|
11784
11718
|
try {
|
|
11785
11719
|
if (fs.existsSync(pkgPath)) {
|
|
11786
11720
|
if (!options$1.preserveSymlinks) pkgPath = safeRealpathSync(pkgPath);
|
|
11787
|
-
|
|
11788
|
-
return resolvePackageEntry(dirPath, pkg, options$1);
|
|
11721
|
+
return resolvePackageEntry(dirPath, loadPackageData(pkgPath), options$1);
|
|
11789
11722
|
}
|
|
11790
11723
|
} catch (e$1) {
|
|
11791
11724
|
if (e$1.code !== ERR_RESOLVE_PACKAGE_ENTRY_FAIL && e$1.code !== "ENOENT") throw e$1;
|
|
@@ -11822,9 +11755,7 @@ function tryNodeResolve(id, importer, options$1, depsOptimizer, externalize) {
|
|
|
11822
11755
|
}
|
|
11823
11756
|
return;
|
|
11824
11757
|
}
|
|
11825
|
-
|
|
11826
|
-
const unresolvedId = deepMatch ? "." + id.slice(pkgId.length) : id;
|
|
11827
|
-
let resolved = resolveId(unresolvedId, pkg, options$1, externalize);
|
|
11758
|
+
let resolved = (deepMatch ? resolveDeepImport : resolvePackageEntry)(deepMatch ? "." + id.slice(pkgId.length) : id, pkg, options$1, externalize);
|
|
11828
11759
|
if (!resolved) return;
|
|
11829
11760
|
const processResult$1 = (resolved$1) => {
|
|
11830
11761
|
if (!externalize) return resolved$1;
|
|
@@ -11911,8 +11842,7 @@ function resolvePackageEntry(id, { dir, data, setResolvedCache, getResolvedCache
|
|
|
11911
11842
|
const { browser: browserField } = data;
|
|
11912
11843
|
if (options$1.mainFields.includes("browser") && isObject(browserField)) entry = mapWithBrowserField(entry, browserField) || entry;
|
|
11913
11844
|
}
|
|
11914
|
-
const
|
|
11915
|
-
const resolvedEntryPoint = tryFsResolve(entryPointPath, options$1, true, skipPackageJson);
|
|
11845
|
+
const resolvedEntryPoint = tryFsResolve(path.join(dir, entry), options$1, true, skipPackageJson);
|
|
11916
11846
|
if (resolvedEntryPoint) {
|
|
11917
11847
|
debug$12?.(`[package entry] ${import_picocolors$25.default.cyan(idWithoutPostfix)} -> ${import_picocolors$25.default.dim(resolvedEntryPoint)}${postfix !== "" ? ` (postfix: ${postfix})` : ""}`);
|
|
11918
11848
|
setResolvedCache(".", resolvedEntryPoint, options$1);
|
|
@@ -11977,8 +11907,7 @@ function tryResolveBrowserMapping(id, importer, options$1, isFilePath, externali
|
|
|
11977
11907
|
let res;
|
|
11978
11908
|
const pkg = importer && findNearestPackageData(path.dirname(importer), options$1.packageCache);
|
|
11979
11909
|
if (pkg && isObject(pkg.data.browser)) {
|
|
11980
|
-
const
|
|
11981
|
-
const browserMappedPath = mapWithBrowserField(mapId, pkg.data.browser);
|
|
11910
|
+
const browserMappedPath = mapWithBrowserField(isFilePath ? "./" + slash(path.relative(pkg.dir, id)) : id, pkg.data.browser);
|
|
11982
11911
|
if (browserMappedPath) {
|
|
11983
11912
|
if (res = bareImportRE.test(browserMappedPath) ? tryNodeResolve(browserMappedPath, importer, options$1, void 0, void 0)?.id : tryFsResolve(path.join(pkg.dir, browserMappedPath), options$1)) {
|
|
11984
11913
|
debug$12?.(`[browser mapped] ${import_picocolors$25.default.cyan(id)} -> ${import_picocolors$25.default.dim(res)}`);
|
|
@@ -12003,11 +11932,8 @@ function tryResolveBrowserEntry(dir, data, options$1) {
|
|
|
12003
11932
|
const browserEntry = typeof data.browser === "string" ? data.browser : isObject(data.browser) && data.browser["."];
|
|
12004
11933
|
if (browserEntry) if (!options$1.isRequire && options$1.mainFields.includes("module") && typeof data.module === "string" && data.module !== browserEntry) {
|
|
12005
11934
|
const resolvedBrowserEntry = tryFsResolve(path.join(dir, browserEntry), options$1);
|
|
12006
|
-
if (resolvedBrowserEntry)
|
|
12007
|
-
|
|
12008
|
-
if (hasESMSyntax(content)) return browserEntry;
|
|
12009
|
-
else return data.module;
|
|
12010
|
-
}
|
|
11935
|
+
if (resolvedBrowserEntry) if (hasESMSyntax(fs.readFileSync(resolvedBrowserEntry, "utf-8"))) return browserEntry;
|
|
11936
|
+
else return data.module;
|
|
12011
11937
|
} else return browserEntry;
|
|
12012
11938
|
}
|
|
12013
11939
|
/**
|
|
@@ -12256,8 +12182,7 @@ var require_main$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/dote
|
|
|
12256
12182
|
const length = keys.length;
|
|
12257
12183
|
let decrypted;
|
|
12258
12184
|
for (let i$1 = 0; i$1 < length; i$1++) try {
|
|
12259
|
-
const
|
|
12260
|
-
const attrs = _instructions(result, key);
|
|
12185
|
+
const attrs = _instructions(result, keys[i$1].trim());
|
|
12261
12186
|
decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
|
|
12262
12187
|
break;
|
|
12263
12188
|
} catch (error$1) {
|
|
@@ -12542,10 +12467,9 @@ function loadEnv(mode, envDir, prefixes = "VITE_") {
|
|
|
12542
12467
|
if (parsed.NODE_ENV && process.env.VITE_USER_NODE_ENV === void 0) process.env.VITE_USER_NODE_ENV = parsed.NODE_ENV;
|
|
12543
12468
|
if (parsed.BROWSER && process.env.BROWSER === void 0) process.env.BROWSER = parsed.BROWSER;
|
|
12544
12469
|
if (parsed.BROWSER_ARGS && process.env.BROWSER_ARGS === void 0) process.env.BROWSER_ARGS = parsed.BROWSER_ARGS;
|
|
12545
|
-
const processEnv = { ...process.env };
|
|
12546
12470
|
(0, import_main$1.expand)({
|
|
12547
12471
|
parsed,
|
|
12548
|
-
processEnv
|
|
12472
|
+
processEnv: { ...process.env }
|
|
12549
12473
|
});
|
|
12550
12474
|
for (const [key, value$1] of Object.entries(parsed)) if (prefixes.some((prefix) => key.startsWith(prefix))) env$1[key] = value$1;
|
|
12551
12475
|
for (const key in process.env) if (prefixes.some((prefix) => key.startsWith(prefix))) env$1[key] = process.env[key];
|
|
@@ -14282,8 +14206,7 @@ var require_vary = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/vary@1
|
|
|
14282
14206
|
function vary(res, field) {
|
|
14283
14207
|
if (!res || !res.getHeader || !res.setHeader) throw new TypeError("res argument is required");
|
|
14284
14208
|
var val = res.getHeader("Vary") || "";
|
|
14285
|
-
|
|
14286
|
-
if (val = append$1(header, field)) res.setHeader("Vary", val);
|
|
14209
|
+
if (val = append$1(Array.isArray(val) ? val.join(", ") : String(val), field)) res.setHeader("Vary", val);
|
|
14287
14210
|
}
|
|
14288
14211
|
}) });
|
|
14289
14212
|
|
|
@@ -15761,7 +15684,7 @@ var require_parse$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/bra
|
|
|
15761
15684
|
*/
|
|
15762
15685
|
if (value$1 === CHAR_LEFT_CURLY_BRACE) {
|
|
15763
15686
|
depth++;
|
|
15764
|
-
|
|
15687
|
+
block = push$1({
|
|
15765
15688
|
type: "brace",
|
|
15766
15689
|
open: true,
|
|
15767
15690
|
close: false,
|
|
@@ -15770,8 +15693,7 @@ var require_parse$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/bra
|
|
|
15770
15693
|
commas: 0,
|
|
15771
15694
|
ranges: 0,
|
|
15772
15695
|
nodes: []
|
|
15773
|
-
};
|
|
15774
|
-
block = push$1(brace);
|
|
15696
|
+
});
|
|
15775
15697
|
stack.push(block);
|
|
15776
15698
|
push$1({
|
|
15777
15699
|
type: "open",
|
|
@@ -16482,8 +16404,7 @@ var require_nodefs_handler = /* @__PURE__ */ __commonJS({ "../../node_modules/.p
|
|
|
16482
16404
|
const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
|
|
16483
16405
|
cont.watcherUnusable = true;
|
|
16484
16406
|
if (isWindows$3 && error$1.code === "EPERM") try {
|
|
16485
|
-
|
|
16486
|
-
await close(fd$1);
|
|
16407
|
+
await close(await open$1(path$13, "r"));
|
|
16487
16408
|
broadcastErr(error$1);
|
|
16488
16409
|
} catch (err$2) {}
|
|
16489
16410
|
else broadcastErr(error$1);
|
|
@@ -17672,8 +17593,7 @@ var require_chokidar = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ch
|
|
|
17672
17593
|
}
|
|
17673
17594
|
const now$1 = Number(/* @__PURE__ */ new Date());
|
|
17674
17595
|
if (prevStat && curStat.size !== prevStat.size) this._pendingWrites.get(path$13).lastChange = now$1;
|
|
17675
|
-
|
|
17676
|
-
if (now$1 - pw.lastChange >= threshold) {
|
|
17596
|
+
if (now$1 - this._pendingWrites.get(path$13).lastChange >= threshold) {
|
|
17677
17597
|
this._pendingWrites.delete(path$13);
|
|
17678
17598
|
awfEmit(void 0, curStat);
|
|
17679
17599
|
} else timeoutHandler = setTimeout(awaitWriteFinish, this.options.awaitWriteFinish.pollInterval, curStat);
|
|
@@ -17707,8 +17627,7 @@ var require_chokidar = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ch
|
|
|
17707
17627
|
const ign = this.options.ignored;
|
|
17708
17628
|
const ignored = ign && ign.map(normalizeIgnored(cwd));
|
|
17709
17629
|
const paths = arrify(ignored).filter((path$14) => typeof path$14 === STRING_TYPE && !isGlob(path$14)).map((path$14) => path$14 + SLASH_GLOBSTAR);
|
|
17710
|
-
|
|
17711
|
-
this._userIgnored = anymatch(list, void 0, ANYMATCH_OPTS);
|
|
17630
|
+
this._userIgnored = anymatch(this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths), void 0, ANYMATCH_OPTS);
|
|
17712
17631
|
}
|
|
17713
17632
|
return this._userIgnored([path$13, stats]);
|
|
17714
17633
|
}
|
|
@@ -17814,13 +17733,12 @@ var require_chokidar = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ch
|
|
|
17814
17733
|
}
|
|
17815
17734
|
_readdirp(root, opts) {
|
|
17816
17735
|
if (this.closed) return;
|
|
17817
|
-
|
|
17736
|
+
let stream$3 = readdirp(root, {
|
|
17818
17737
|
type: EV_ALL,
|
|
17819
17738
|
alwaysStat: true,
|
|
17820
17739
|
lstat: true,
|
|
17821
17740
|
...opts
|
|
17822
|
-
};
|
|
17823
|
-
let stream$3 = readdirp(root, options$1);
|
|
17741
|
+
});
|
|
17824
17742
|
this._streams.add(stream$3);
|
|
17825
17743
|
stream$3.once(STR_CLOSE, () => {
|
|
17826
17744
|
stream$3 = void 0;
|
|
@@ -17911,8 +17829,7 @@ var require_parse$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/she
|
|
|
17911
17829
|
if (!opts) opts = {};
|
|
17912
17830
|
var BS = opts.escape || "\\";
|
|
17913
17831
|
var BAREWORD = "(\\" + BS + "['\"" + META + "]|[^\\s'\"" + META + "])+";
|
|
17914
|
-
var
|
|
17915
|
-
var matches$2 = matchAll(string, chunker);
|
|
17832
|
+
var matches$2 = matchAll(string, new RegExp(["(" + CONTROL + ")", "(" + BAREWORD + "|" + SINGLE_QUOTE + "|" + DOUBLE_QUOTE + ")+"].join("|"), "g"));
|
|
17916
17833
|
if (matches$2.length === 0) return [];
|
|
17917
17834
|
if (!env$1) env$1 = {};
|
|
17918
17835
|
var commented = false;
|
|
@@ -18379,8 +18296,7 @@ var require_launch_editor_middleware = /* @__PURE__ */ __commonJS({ "../../node_
|
|
|
18379
18296
|
res.statusCode = 500;
|
|
18380
18297
|
res.end(`launch-editor-middleware: required query param "file" is missing.`);
|
|
18381
18298
|
} else {
|
|
18382
|
-
|
|
18383
|
-
launch(resolved, specifiedEditor, onErrorCallback);
|
|
18299
|
+
launch(file.startsWith("file://") ? file : path$5.resolve(srcRoot, file), specifiedEditor, onErrorCallback);
|
|
18384
18300
|
res.end();
|
|
18385
18301
|
}
|
|
18386
18302
|
};
|
|
@@ -18407,16 +18323,16 @@ async function resolveHttpServer({ proxy }, app, httpsOptions) {
|
|
|
18407
18323
|
}, app);
|
|
18408
18324
|
}
|
|
18409
18325
|
}
|
|
18410
|
-
async function resolveHttpsConfig(https$
|
|
18411
|
-
if (!https$
|
|
18326
|
+
async function resolveHttpsConfig(https$4) {
|
|
18327
|
+
if (!https$4) return void 0;
|
|
18412
18328
|
const [ca, cert, key, pfx] = await Promise.all([
|
|
18413
|
-
readFileIfExists(https$
|
|
18414
|
-
readFileIfExists(https$
|
|
18415
|
-
readFileIfExists(https$
|
|
18416
|
-
readFileIfExists(https$
|
|
18329
|
+
readFileIfExists(https$4.ca),
|
|
18330
|
+
readFileIfExists(https$4.cert),
|
|
18331
|
+
readFileIfExists(https$4.key),
|
|
18332
|
+
readFileIfExists(https$4.pfx)
|
|
18417
18333
|
]);
|
|
18418
18334
|
return {
|
|
18419
|
-
...https$
|
|
18335
|
+
...https$4,
|
|
18420
18336
|
ca,
|
|
18421
18337
|
cert,
|
|
18422
18338
|
key,
|
|
@@ -18481,8 +18397,7 @@ function ssrRewriteStacktrace(stack, moduleGraph) {
|
|
|
18481
18397
|
if (!id) return input;
|
|
18482
18398
|
const rawSourceMap = moduleGraph.getModuleById(id)?.transformResult?.map;
|
|
18483
18399
|
if (!rawSourceMap) return input;
|
|
18484
|
-
const
|
|
18485
|
-
const pos = originalPositionFor(traced, {
|
|
18400
|
+
const pos = originalPositionFor(new TraceMap(rawSourceMap), {
|
|
18486
18401
|
line: Number(line$1) - offset,
|
|
18487
18402
|
column: Number(column) - 1
|
|
18488
18403
|
});
|
|
@@ -18508,8 +18423,7 @@ const rewroteStacktraces = /* @__PURE__ */ new WeakSet();
|
|
|
18508
18423
|
function ssrFixStacktrace(e$1, moduleGraph) {
|
|
18509
18424
|
if (!e$1.stack) return;
|
|
18510
18425
|
if (rewroteStacktraces.has(e$1)) return;
|
|
18511
|
-
|
|
18512
|
-
rebindErrorStacktrace(e$1, stacktrace);
|
|
18426
|
+
rebindErrorStacktrace(e$1, ssrRewriteStacktrace(e$1.stack, moduleGraph));
|
|
18513
18427
|
rewroteStacktraces.add(e$1);
|
|
18514
18428
|
}
|
|
18515
18429
|
|
|
@@ -18962,8 +18876,7 @@ async function ssrTransformScript(code, inMap, url$3, originalCode) {
|
|
|
18962
18876
|
for (const spec of node.specifiers) {
|
|
18963
18877
|
const local = spec.local.name;
|
|
18964
18878
|
const binding = idToImportMap.get(local);
|
|
18965
|
-
|
|
18966
|
-
defineExport(exportedAs, binding || local);
|
|
18879
|
+
defineExport(getIdentifierNameOrLiteralValue$1(spec.exported), binding || local);
|
|
18967
18880
|
}
|
|
18968
18881
|
}
|
|
18969
18882
|
if (node.type === "ExportDefaultDeclaration") if ("id" in node.declaration && node.declaration.id && !["FunctionExpression", "ClassExpression"].includes(node.declaration.type)) {
|
|
@@ -18977,10 +18890,8 @@ async function ssrTransformScript(code, inMap, url$3, originalCode) {
|
|
|
18977
18890
|
}
|
|
18978
18891
|
if (node.type === "ExportAllDeclaration") {
|
|
18979
18892
|
const importId = reExportImportIdMap.get(node);
|
|
18980
|
-
if (node.exported) {
|
|
18981
|
-
|
|
18982
|
-
defineExport(exportedAs, `${importId}`);
|
|
18983
|
-
} else s$2.appendLeft(node.end, `${ssrExportAllKey}(${importId});\n`);
|
|
18893
|
+
if (node.exported) defineExport(getIdentifierNameOrLiteralValue$1(node.exported), `${importId}`);
|
|
18894
|
+
else s$2.appendLeft(node.end, `${ssrExportAllKey}(${importId});\n`);
|
|
18984
18895
|
}
|
|
18985
18896
|
}
|
|
18986
18897
|
walk$1(ast, {
|
|
@@ -19393,14 +19304,13 @@ Get the default browser name in Windows from WSL.
|
|
|
19393
19304
|
async function getWindowsDefaultBrowserFromWsl() {
|
|
19394
19305
|
const powershellPath = await powerShellPath();
|
|
19395
19306
|
const rawCommand = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
|
|
19396
|
-
const encodedCommand = Buffer$1.from(rawCommand, "utf16le").toString("base64");
|
|
19397
19307
|
const { stdout } = await execFile$1(powershellPath, [
|
|
19398
19308
|
"-NoProfile",
|
|
19399
19309
|
"-NonInteractive",
|
|
19400
19310
|
"-ExecutionPolicy",
|
|
19401
19311
|
"Bypass",
|
|
19402
19312
|
"-EncodedCommand",
|
|
19403
|
-
|
|
19313
|
+
Buffer$1.from(rawCommand, "utf16le").toString("base64")
|
|
19404
19314
|
], { encoding: "utf8" });
|
|
19405
19315
|
const progId = stdout.trim();
|
|
19406
19316
|
const browserMap = {
|
|
@@ -19723,8 +19633,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
|
|
|
19723
19633
|
const ppRaw = pathEnv[i$1];
|
|
19724
19634
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
19725
19635
|
const pCmd = path$4.join(pathPart, cmd);
|
|
19726
|
-
|
|
19727
|
-
resolve$4(subStep(p, i$1, 0));
|
|
19636
|
+
resolve$4(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i$1, 0));
|
|
19728
19637
|
});
|
|
19729
19638
|
const subStep = (p, i$1, ii) => new Promise((resolve$4, reject) => {
|
|
19730
19639
|
if (ii === pathExt.length) return resolve$4(step(i$1 + 1));
|
|
@@ -20003,10 +19912,7 @@ var import_picocolors$19 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
|
20003
19912
|
function openBrowser(url$3, opt, logger) {
|
|
20004
19913
|
const browser = typeof opt === "string" ? opt : process.env.BROWSER || "";
|
|
20005
19914
|
if (browser.toLowerCase().endsWith(".js")) executeNodeScript(browser, url$3, logger);
|
|
20006
|
-
else if (browser.toLowerCase() !== "none")
|
|
20007
|
-
const browserArgs = process.env.BROWSER_ARGS ? process.env.BROWSER_ARGS.split(" ") : [];
|
|
20008
|
-
startBrowserProcess(browser, browserArgs, url$3, logger);
|
|
20009
|
-
}
|
|
19915
|
+
else if (browser.toLowerCase() !== "none") startBrowserProcess(browser, process.env.BROWSER_ARGS ? process.env.BROWSER_ARGS.split(" ") : [], url$3, logger);
|
|
20010
19916
|
}
|
|
20011
19917
|
function executeNodeScript(scriptPath, url$3, logger) {
|
|
20012
19918
|
const extraArgs = process.argv.slice(2);
|
|
@@ -21077,14 +20983,12 @@ var require_receiver = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ws
|
|
|
21077
20983
|
}
|
|
21078
20984
|
const buf = this.consume(2);
|
|
21079
20985
|
if ((buf[0] & 48) !== 0) {
|
|
21080
|
-
|
|
21081
|
-
cb(error$1);
|
|
20986
|
+
cb(this.createError(RangeError, "RSV2 and RSV3 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_2_3"));
|
|
21082
20987
|
return;
|
|
21083
20988
|
}
|
|
21084
20989
|
const compressed = (buf[0] & 64) === 64;
|
|
21085
20990
|
if (compressed && !this._extensions[PerMessageDeflate$3.extensionName]) {
|
|
21086
|
-
|
|
21087
|
-
cb(error$1);
|
|
20991
|
+
cb(this.createError(RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1"));
|
|
21088
20992
|
return;
|
|
21089
20993
|
}
|
|
21090
20994
|
this._fin = (buf[0] & 128) === 128;
|
|
@@ -21092,55 +20996,46 @@ var require_receiver = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ws
|
|
|
21092
20996
|
this._payloadLength = buf[1] & 127;
|
|
21093
20997
|
if (this._opcode === 0) {
|
|
21094
20998
|
if (compressed) {
|
|
21095
|
-
|
|
21096
|
-
cb(error$1);
|
|
20999
|
+
cb(this.createError(RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1"));
|
|
21097
21000
|
return;
|
|
21098
21001
|
}
|
|
21099
21002
|
if (!this._fragmented) {
|
|
21100
|
-
|
|
21101
|
-
cb(error$1);
|
|
21003
|
+
cb(this.createError(RangeError, "invalid opcode 0", true, 1002, "WS_ERR_INVALID_OPCODE"));
|
|
21102
21004
|
return;
|
|
21103
21005
|
}
|
|
21104
21006
|
this._opcode = this._fragmented;
|
|
21105
21007
|
} else if (this._opcode === 1 || this._opcode === 2) {
|
|
21106
21008
|
if (this._fragmented) {
|
|
21107
|
-
|
|
21108
|
-
cb(error$1);
|
|
21009
|
+
cb(this.createError(RangeError, `invalid opcode ${this._opcode}`, true, 1002, "WS_ERR_INVALID_OPCODE"));
|
|
21109
21010
|
return;
|
|
21110
21011
|
}
|
|
21111
21012
|
this._compressed = compressed;
|
|
21112
21013
|
} else if (this._opcode > 7 && this._opcode < 11) {
|
|
21113
21014
|
if (!this._fin) {
|
|
21114
|
-
|
|
21115
|
-
cb(error$1);
|
|
21015
|
+
cb(this.createError(RangeError, "FIN must be set", true, 1002, "WS_ERR_EXPECTED_FIN"));
|
|
21116
21016
|
return;
|
|
21117
21017
|
}
|
|
21118
21018
|
if (compressed) {
|
|
21119
|
-
|
|
21120
|
-
cb(error$1);
|
|
21019
|
+
cb(this.createError(RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1"));
|
|
21121
21020
|
return;
|
|
21122
21021
|
}
|
|
21123
21022
|
if (this._payloadLength > 125 || this._opcode === 8 && this._payloadLength === 1) {
|
|
21124
|
-
|
|
21125
|
-
cb(error$1);
|
|
21023
|
+
cb(this.createError(RangeError, `invalid payload length ${this._payloadLength}`, true, 1002, "WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH"));
|
|
21126
21024
|
return;
|
|
21127
21025
|
}
|
|
21128
21026
|
} else {
|
|
21129
|
-
|
|
21130
|
-
cb(error$1);
|
|
21027
|
+
cb(this.createError(RangeError, `invalid opcode ${this._opcode}`, true, 1002, "WS_ERR_INVALID_OPCODE"));
|
|
21131
21028
|
return;
|
|
21132
21029
|
}
|
|
21133
21030
|
if (!this._fin && !this._fragmented) this._fragmented = this._opcode;
|
|
21134
21031
|
this._masked = (buf[1] & 128) === 128;
|
|
21135
21032
|
if (this._isServer) {
|
|
21136
21033
|
if (!this._masked) {
|
|
21137
|
-
|
|
21138
|
-
cb(error$1);
|
|
21034
|
+
cb(this.createError(RangeError, "MASK must be set", true, 1002, "WS_ERR_EXPECTED_MASK"));
|
|
21139
21035
|
return;
|
|
21140
21036
|
}
|
|
21141
21037
|
} else if (this._masked) {
|
|
21142
|
-
|
|
21143
|
-
cb(error$1);
|
|
21038
|
+
cb(this.createError(RangeError, "MASK must be clear", true, 1002, "WS_ERR_UNEXPECTED_MASK"));
|
|
21144
21039
|
return;
|
|
21145
21040
|
}
|
|
21146
21041
|
if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16;
|
|
@@ -21175,8 +21070,7 @@ var require_receiver = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ws
|
|
|
21175
21070
|
const buf = this.consume(8);
|
|
21176
21071
|
const num = buf.readUInt32BE(0);
|
|
21177
21072
|
if (num > Math.pow(2, 21) - 1) {
|
|
21178
|
-
|
|
21179
|
-
cb(error$1);
|
|
21073
|
+
cb(this.createError(RangeError, "Unsupported WebSocket frame: payload length > 2^53 - 1", false, 1009, "WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH"));
|
|
21180
21074
|
return;
|
|
21181
21075
|
}
|
|
21182
21076
|
this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4);
|
|
@@ -21192,8 +21086,7 @@ var require_receiver = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ws
|
|
|
21192
21086
|
if (this._payloadLength && this._opcode < 8) {
|
|
21193
21087
|
this._totalPayloadLength += this._payloadLength;
|
|
21194
21088
|
if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) {
|
|
21195
|
-
|
|
21196
|
-
cb(error$1);
|
|
21089
|
+
cb(this.createError(RangeError, "Max payload size exceeded", false, 1009, "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));
|
|
21197
21090
|
return;
|
|
21198
21091
|
}
|
|
21199
21092
|
}
|
|
@@ -21257,8 +21150,7 @@ var require_receiver = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ws
|
|
|
21257
21150
|
if (buf.length) {
|
|
21258
21151
|
this._messageLength += buf.length;
|
|
21259
21152
|
if (this._messageLength > this._maxPayload && this._maxPayload > 0) {
|
|
21260
|
-
|
|
21261
|
-
cb(error$1);
|
|
21153
|
+
cb(this.createError(RangeError, "Max payload size exceeded", false, 1009, "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));
|
|
21262
21154
|
return;
|
|
21263
21155
|
}
|
|
21264
21156
|
this._fragments.push(buf);
|
|
@@ -21304,8 +21196,7 @@ var require_receiver = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ws
|
|
|
21304
21196
|
} else {
|
|
21305
21197
|
const buf = concat(fragments, messageLength);
|
|
21306
21198
|
if (!this._skipUTF8Validation && !isValidUTF8(buf)) {
|
|
21307
|
-
|
|
21308
|
-
cb(error$1);
|
|
21199
|
+
cb(this.createError(Error, "invalid UTF-8 sequence", true, 1007, "WS_ERR_INVALID_UTF8"));
|
|
21309
21200
|
return;
|
|
21310
21201
|
}
|
|
21311
21202
|
if (this._state === INFLATING || this._allowSynchronousEvents) {
|
|
@@ -21337,14 +21228,12 @@ var require_receiver = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ws
|
|
|
21337
21228
|
} else {
|
|
21338
21229
|
const code = data.readUInt16BE(0);
|
|
21339
21230
|
if (!isValidStatusCode$1(code)) {
|
|
21340
|
-
|
|
21341
|
-
cb(error$1);
|
|
21231
|
+
cb(this.createError(RangeError, `invalid status code ${code}`, true, 1002, "WS_ERR_INVALID_CLOSE_CODE"));
|
|
21342
21232
|
return;
|
|
21343
21233
|
}
|
|
21344
21234
|
const buf = new FastBuffer(data.buffer, data.byteOffset + 2, data.length - 2);
|
|
21345
21235
|
if (!this._skipUTF8Validation && !isValidUTF8(buf)) {
|
|
21346
|
-
|
|
21347
|
-
cb(error$1);
|
|
21236
|
+
cb(this.createError(Error, "invalid UTF-8 sequence", true, 1007, "WS_ERR_INVALID_UTF8"));
|
|
21348
21237
|
return;
|
|
21349
21238
|
}
|
|
21350
21239
|
this._loop = false;
|
|
@@ -22255,7 +22144,7 @@ var require_extension = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/w
|
|
|
22255
22144
|
//#region ../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/websocket.js
|
|
22256
22145
|
var require_websocket = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ws@8.18.3/node_modules/ws/lib/websocket.js": ((exports, module) => {
|
|
22257
22146
|
const EventEmitter$2 = __require("events");
|
|
22258
|
-
const https$
|
|
22147
|
+
const https$3 = __require("https");
|
|
22259
22148
|
const http$5 = __require("http");
|
|
22260
22149
|
const net$1 = __require("net");
|
|
22261
22150
|
const tls = __require("tls");
|
|
@@ -22811,7 +22700,7 @@ var require_websocket = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/w
|
|
|
22811
22700
|
}
|
|
22812
22701
|
const defaultPort = isSecure ? 443 : 80;
|
|
22813
22702
|
const key = randomBytes(16).toString("base64");
|
|
22814
|
-
const request = isSecure ? https$
|
|
22703
|
+
const request = isSecure ? https$3.request : http$5.request;
|
|
22815
22704
|
const protocolSet = /* @__PURE__ */ new Set();
|
|
22816
22705
|
let perMessageDeflate;
|
|
22817
22706
|
opts.createConnection = opts.createConnection || (isSecure ? tlsConnect : netConnect);
|
|
@@ -22892,8 +22781,7 @@ var require_websocket = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/w
|
|
|
22892
22781
|
try {
|
|
22893
22782
|
addr = new URL$3(location$1, address);
|
|
22894
22783
|
} catch (e$1) {
|
|
22895
|
-
|
|
22896
|
-
emitErrorAndClose(websocket, err$2);
|
|
22784
|
+
emitErrorAndClose(websocket, /* @__PURE__ */ new SyntaxError(`Invalid URL: ${location$1}`));
|
|
22897
22785
|
return;
|
|
22898
22786
|
}
|
|
22899
22787
|
initAsClient(websocket, addr, protocols, options$1);
|
|
@@ -23755,7 +23643,7 @@ var import_websocket = /* @__PURE__ */ __toESM(require_websocket(), 1);
|
|
|
23755
23643
|
var import_websocket_server = /* @__PURE__ */ __toESM(require_websocket_server(), 1);
|
|
23756
23644
|
|
|
23757
23645
|
//#endregion
|
|
23758
|
-
//#region ../../node_modules/.pnpm/host-validation-middleware@0.1.
|
|
23646
|
+
//#region ../../node_modules/.pnpm/host-validation-middleware@0.1.2/node_modules/host-validation-middleware/dist/index.js
|
|
23759
23647
|
/**
|
|
23760
23648
|
* This function assumes that the input is not malformed.
|
|
23761
23649
|
* This is because we only care about browser requests.
|
|
@@ -23889,10 +23777,7 @@ function createWebSocketServer(server, config$2, httpsOptions) {
|
|
|
23889
23777
|
if (req$4.headers["sec-websocket-protocol"] === "vite-ping") return true;
|
|
23890
23778
|
if (allowedHosts !== true && !isHostAllowed(req$4.headers.host, allowedHosts)) return false;
|
|
23891
23779
|
if (config$2.legacy?.skipWebSocketTokenCheck) return true;
|
|
23892
|
-
if (req$4.headers.origin) {
|
|
23893
|
-
const parsedUrl = new URL(`http://example.com${req$4.url}`);
|
|
23894
|
-
return hasValidToken(config$2, parsedUrl);
|
|
23895
|
-
}
|
|
23780
|
+
if (req$4.headers.origin) return hasValidToken(config$2, new URL(`http://example.com${req$4.url}`));
|
|
23896
23781
|
return true;
|
|
23897
23782
|
};
|
|
23898
23783
|
const handleUpgrade = (req$4, socket, head, isPing) => {
|
|
@@ -24083,8 +23968,8 @@ function baseMiddleware(rawBase, middlewareMode) {
|
|
|
24083
23968
|
}
|
|
24084
23969
|
|
|
24085
23970
|
//#endregion
|
|
24086
|
-
//#region ../../node_modules/.pnpm/http-proxy-3@1.
|
|
24087
|
-
var require_common = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/http-proxy-3@1.
|
|
23971
|
+
//#region ../../node_modules/.pnpm/http-proxy-3@1.22.0/node_modules/http-proxy-3/dist/lib/http-proxy/common.js
|
|
23972
|
+
var require_common = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/http-proxy-3@1.22.0/node_modules/http-proxy-3/dist/lib/http-proxy/common.js": ((exports) => {
|
|
24088
23973
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24089
23974
|
exports.isSSL = void 0;
|
|
24090
23975
|
exports.setupOutgoing = setupOutgoing;
|
|
@@ -24098,6 +23983,12 @@ var require_common = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/http
|
|
|
24098
23983
|
const upgradeHeader = /(^|,)\s*upgrade\s*($|,)/i;
|
|
24099
23984
|
exports.isSSL = /^https|wss/;
|
|
24100
23985
|
const HEADER_BLACKLIST = "trailer";
|
|
23986
|
+
const HTTP2_HEADER_BLACKLIST = [
|
|
23987
|
+
":method",
|
|
23988
|
+
":path",
|
|
23989
|
+
":scheme",
|
|
23990
|
+
":authority"
|
|
23991
|
+
];
|
|
24101
23992
|
function setupOutgoing(outgoing, options$1, req$4, forward) {
|
|
24102
23993
|
const target = options$1[forward || "target"];
|
|
24103
23994
|
outgoing.port = +(target.port ?? (target.protocol !== void 0 && exports.isSSL.test(target.protocol) ? 443 : 80));
|
|
@@ -24123,6 +24014,7 @@ var require_common = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/http
|
|
|
24123
24014
|
delete outgoing.headers[header];
|
|
24124
24015
|
break;
|
|
24125
24016
|
}
|
|
24017
|
+
if (req$4.httpVersionMajor > 1) for (const header of HTTP2_HEADER_BLACKLIST) delete outgoing.headers[header];
|
|
24126
24018
|
if (options$1.auth) {
|
|
24127
24019
|
delete outgoing.headers.authorization;
|
|
24128
24020
|
outgoing.auth = options$1.auth;
|
|
@@ -24203,8 +24095,8 @@ var require_common = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/http
|
|
|
24203
24095
|
else if (typeof url$3 === "object" && "href" in url$3 && typeof url$3.href === "string") url$3 = url$3.href;
|
|
24204
24096
|
if (!url$3) url$3 = "";
|
|
24205
24097
|
if (typeof url$3 != "string") url$3 = `${url$3}`;
|
|
24206
|
-
if (url$3.startsWith("//")) url$3 = `http://
|
|
24207
|
-
return new URL(url$3, "http://
|
|
24098
|
+
if (url$3.startsWith("//")) url$3 = `http://base.invalid${url$3}`;
|
|
24099
|
+
return new URL(url$3, "http://base.invalid");
|
|
24208
24100
|
}
|
|
24209
24101
|
function required(port, protocol) {
|
|
24210
24102
|
protocol = protocol.split(":")[0];
|
|
@@ -24221,8 +24113,8 @@ var require_common = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/http
|
|
|
24221
24113
|
}) });
|
|
24222
24114
|
|
|
24223
24115
|
//#endregion
|
|
24224
|
-
//#region ../../node_modules/.pnpm/http-proxy-3@1.
|
|
24225
|
-
var require_web_outgoing = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/http-proxy-3@1.
|
|
24116
|
+
//#region ../../node_modules/.pnpm/http-proxy-3@1.22.0/node_modules/http-proxy-3/dist/lib/http-proxy/passes/web-outgoing.js
|
|
24117
|
+
var require_web_outgoing = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/http-proxy-3@1.22.0/node_modules/http-proxy-3/dist/lib/http-proxy/passes/web-outgoing.js": ((exports) => {
|
|
24226
24118
|
var __createBinding$3 = exports && exports.__createBinding || (Object.create ? (function(o$1, m$2, k, k2) {
|
|
24227
24119
|
if (k2 === void 0) k2 = k;
|
|
24228
24120
|
var desc = Object.getOwnPropertyDescriptor(m$2, k);
|
|
@@ -24312,16 +24204,15 @@ var require_web_outgoing = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
|
|
|
24312
24204
|
}
|
|
24313
24205
|
for (const key0 in proxyRes.headers) {
|
|
24314
24206
|
let key = key0;
|
|
24207
|
+
if (_req.httpVersionMajor > 1 && key === "connection") continue;
|
|
24315
24208
|
const header = proxyRes.headers[key];
|
|
24316
24209
|
if (preserveHeaderKeyCase && rawHeaderKeyMap) key = rawHeaderKeyMap[key] ?? key;
|
|
24317
24210
|
setHeader(key, header);
|
|
24318
24211
|
}
|
|
24319
24212
|
}
|
|
24320
24213
|
function writeStatusCode(_req, res, proxyRes) {
|
|
24321
|
-
|
|
24322
|
-
|
|
24323
|
-
res.statusMessage = proxyRes.statusMessage;
|
|
24324
|
-
} else res.statusCode = proxyRes.statusCode;
|
|
24214
|
+
res.statusCode = proxyRes.statusCode;
|
|
24215
|
+
if (proxyRes.statusMessage && _req.httpVersionMajor === 1) res.statusMessage = proxyRes.statusMessage;
|
|
24325
24216
|
}
|
|
24326
24217
|
exports.OUTGOING_PASSES = {
|
|
24327
24218
|
removeChunked,
|
|
@@ -24353,7 +24244,7 @@ var require_follow_redirects = /* @__PURE__ */ __commonJS({ "../../node_modules/
|
|
|
24353
24244
|
var url = __require("url");
|
|
24354
24245
|
var URL$2 = url.URL;
|
|
24355
24246
|
var http$3 = __require("http");
|
|
24356
|
-
var https$
|
|
24247
|
+
var https$2 = __require("https");
|
|
24357
24248
|
var Writable = __require("stream").Writable;
|
|
24358
24249
|
var assert$1 = __require("assert");
|
|
24359
24250
|
var debug$6 = require_debug();
|
|
@@ -24773,14 +24664,14 @@ var require_follow_redirects = /* @__PURE__ */ __commonJS({ "../../node_modules/
|
|
|
24773
24664
|
}
|
|
24774
24665
|
module.exports = wrap({
|
|
24775
24666
|
http: http$3,
|
|
24776
|
-
https: https$
|
|
24667
|
+
https: https$2
|
|
24777
24668
|
});
|
|
24778
24669
|
module.exports.wrap = wrap;
|
|
24779
24670
|
}) });
|
|
24780
24671
|
|
|
24781
24672
|
//#endregion
|
|
24782
|
-
//#region ../../node_modules/.pnpm/http-proxy-3@1.
|
|
24783
|
-
var require_web_incoming = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/http-proxy-3@1.
|
|
24673
|
+
//#region ../../node_modules/.pnpm/http-proxy-3@1.22.0/node_modules/http-proxy-3/dist/lib/http-proxy/passes/web-incoming.js
|
|
24674
|
+
var require_web_incoming = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/http-proxy-3@1.22.0/node_modules/http-proxy-3/dist/lib/http-proxy/passes/web-incoming.js": ((exports) => {
|
|
24784
24675
|
var __createBinding$2 = exports && exports.__createBinding || (Object.create ? (function(o$1, m$2, k, k2) {
|
|
24785
24676
|
if (k2 === void 0) k2 = k;
|
|
24786
24677
|
var desc = Object.getOwnPropertyDescriptor(m$2, k);
|
|
@@ -24828,14 +24719,14 @@ var require_web_incoming = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
|
|
|
24828
24719
|
exports.XHeaders = XHeaders$1;
|
|
24829
24720
|
exports.stream = stream$1;
|
|
24830
24721
|
const http$2 = __importStar$2(__require("node:http"));
|
|
24831
|
-
const https$
|
|
24722
|
+
const https$1 = __importStar$2(__require("node:https"));
|
|
24832
24723
|
const web_outgoing_1$1 = require_web_outgoing();
|
|
24833
24724
|
const common$1 = __importStar$2(require_common());
|
|
24834
24725
|
const followRedirects = __importStar$2(require_follow_redirects());
|
|
24835
24726
|
const web_o$1 = Object.values(web_outgoing_1$1.OUTGOING_PASSES);
|
|
24836
24727
|
const nativeAgents = {
|
|
24837
24728
|
http: http$2,
|
|
24838
|
-
https: https$
|
|
24729
|
+
https: https$1
|
|
24839
24730
|
};
|
|
24840
24731
|
function deleteLength(req$4) {
|
|
24841
24732
|
if ((req$4.method === "DELETE" || req$4.method === "OPTIONS") && !req$4.headers["content-length"]) {
|
|
@@ -24865,9 +24756,9 @@ var require_web_incoming = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
|
|
|
24865
24756
|
server.emit("start", req$4, res, options$1.target || options$1.forward);
|
|
24866
24757
|
const agents = options$1.followRedirects ? followRedirects : nativeAgents;
|
|
24867
24758
|
const http$7 = agents.http;
|
|
24868
|
-
const https$
|
|
24759
|
+
const https$4 = agents.https;
|
|
24869
24760
|
if (options$1.forward) {
|
|
24870
|
-
const proto$2 = options$1.forward.protocol === "https:" ? https$
|
|
24761
|
+
const proto$2 = options$1.forward.protocol === "https:" ? https$4 : http$7;
|
|
24871
24762
|
const outgoingOptions$1 = common$1.setupOutgoing(options$1.ssl || {}, options$1, req$4, "forward");
|
|
24872
24763
|
const forwardReq = proto$2.request(outgoingOptions$1);
|
|
24873
24764
|
const forwardError = createErrorHandler(forwardReq, options$1.forward);
|
|
@@ -24876,7 +24767,7 @@ var require_web_incoming = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
|
|
|
24876
24767
|
(options$1.buffer || req$4).pipe(forwardReq);
|
|
24877
24768
|
if (!options$1.target) return res.end();
|
|
24878
24769
|
}
|
|
24879
|
-
const proto$1 = options$1.target.protocol === "https:" ? https$
|
|
24770
|
+
const proto$1 = options$1.target.protocol === "https:" ? https$4 : http$7;
|
|
24880
24771
|
const outgoingOptions = common$1.setupOutgoing(options$1.ssl || {}, options$1, req$4);
|
|
24881
24772
|
const proxyReq = proto$1.request(outgoingOptions);
|
|
24882
24773
|
proxyReq.on("socket", (socket) => {
|
|
@@ -24923,8 +24814,8 @@ var require_web_incoming = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
|
|
|
24923
24814
|
}) });
|
|
24924
24815
|
|
|
24925
24816
|
//#endregion
|
|
24926
|
-
//#region ../../node_modules/.pnpm/http-proxy-3@1.
|
|
24927
|
-
var require_ws_incoming = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/http-proxy-3@1.
|
|
24817
|
+
//#region ../../node_modules/.pnpm/http-proxy-3@1.22.0/node_modules/http-proxy-3/dist/lib/http-proxy/passes/ws-incoming.js
|
|
24818
|
+
var require_ws_incoming = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/http-proxy-3@1.22.0/node_modules/http-proxy-3/dist/lib/http-proxy/passes/ws-incoming.js": ((exports) => {
|
|
24928
24819
|
var __createBinding$1 = exports && exports.__createBinding || (Object.create ? (function(o$1, m$2, k, k2) {
|
|
24929
24820
|
if (k2 === void 0) k2 = k;
|
|
24930
24821
|
var desc = Object.getOwnPropertyDescriptor(m$2, k);
|
|
@@ -24975,7 +24866,7 @@ var require_ws_incoming = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
24975
24866
|
exports.XHeaders = XHeaders;
|
|
24976
24867
|
exports.stream = stream;
|
|
24977
24868
|
const http$1 = __importStar$1(__require("node:http"));
|
|
24978
|
-
const https
|
|
24869
|
+
const https = __importStar$1(__require("node:https"));
|
|
24979
24870
|
const common = __importStar$1(require_common());
|
|
24980
24871
|
const web_outgoing_1 = require_web_outgoing();
|
|
24981
24872
|
const log$1 = (0, __importDefault$1(require_node$1()).default)("http-proxy-3:ws-incoming");
|
|
@@ -25061,7 +24952,7 @@ var require_ws_incoming = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
25061
24952
|
};
|
|
25062
24953
|
common.setupSocket(socket);
|
|
25063
24954
|
if (head && head.length) socket.unshift(head);
|
|
25064
|
-
const proto$1 = common.isSSL.test(options$1.target.protocol) ? https
|
|
24955
|
+
const proto$1 = common.isSSL.test(options$1.target.protocol) ? https : http$1;
|
|
25065
24956
|
const outgoingOptions = common.setupOutgoing(options$1.ssl || {}, options$1, req$4);
|
|
25066
24957
|
const proxyReq = proto$1.request(outgoingOptions);
|
|
25067
24958
|
if (server) server.emit("proxyReqWs", proxyReq, req$4, socket, options$1, head);
|
|
@@ -25132,8 +25023,8 @@ var require_ws_incoming = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
25132
25023
|
}) });
|
|
25133
25024
|
|
|
25134
25025
|
//#endregion
|
|
25135
|
-
//#region ../../node_modules/.pnpm/http-proxy-3@1.
|
|
25136
|
-
var require_http_proxy = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/http-proxy-3@1.
|
|
25026
|
+
//#region ../../node_modules/.pnpm/http-proxy-3@1.22.0/node_modules/http-proxy-3/dist/lib/http-proxy/index.js
|
|
25027
|
+
var require_http_proxy = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/http-proxy-3@1.22.0/node_modules/http-proxy-3/dist/lib/http-proxy/index.js": ((exports) => {
|
|
25137
25028
|
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o$1, m$2, k, k2) {
|
|
25138
25029
|
if (k2 === void 0) k2 = k;
|
|
25139
25030
|
var desc = Object.getOwnPropertyDescriptor(m$2, k);
|
|
@@ -25180,7 +25071,7 @@ var require_http_proxy = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
25180
25071
|
};
|
|
25181
25072
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25182
25073
|
const http = __importStar(__require("node:http"));
|
|
25183
|
-
const
|
|
25074
|
+
const http2 = __importStar(__require("node:http2"));
|
|
25184
25075
|
const web_incoming_1 = require_web_incoming();
|
|
25185
25076
|
const ws_incoming_1$1 = require_ws_incoming();
|
|
25186
25077
|
const node_events_1 = __require("node:events");
|
|
@@ -25258,7 +25149,10 @@ var require_http_proxy = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
25258
25149
|
const requestListener = (req$4, res) => {
|
|
25259
25150
|
this.web(req$4, res);
|
|
25260
25151
|
};
|
|
25261
|
-
this._server = this.options.ssl ?
|
|
25152
|
+
this._server = this.options.ssl ? http2.createSecureServer({
|
|
25153
|
+
...this.options.ssl,
|
|
25154
|
+
allowHTTP1: true
|
|
25155
|
+
}, requestListener) : http.createServer(requestListener);
|
|
25262
25156
|
if (this.options.ws) this._server.on("upgrade", (req$4, socket, head) => {
|
|
25263
25157
|
this.ws(req$4, socket, head);
|
|
25264
25158
|
});
|
|
@@ -25339,8 +25233,8 @@ var require_http_proxy = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
25339
25233
|
}) });
|
|
25340
25234
|
|
|
25341
25235
|
//#endregion
|
|
25342
|
-
//#region ../../node_modules/.pnpm/http-proxy-3@1.
|
|
25343
|
-
var require_lib = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/http-proxy-3@1.
|
|
25236
|
+
//#region ../../node_modules/.pnpm/http-proxy-3@1.22.0/node_modules/http-proxy-3/dist/lib/index.js
|
|
25237
|
+
var require_lib = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/http-proxy-3@1.22.0/node_modules/http-proxy-3/dist/lib/index.js": ((exports) => {
|
|
25344
25238
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25345
25239
|
exports.numOpenSockets = exports.ProxyServer = void 0;
|
|
25346
25240
|
exports.createProxyServer = createProxyServer;
|
|
@@ -25644,8 +25538,7 @@ function send(req$4, res, content, type, options$1) {
|
|
|
25644
25538
|
if (import_convert_source_map$1.default.mapFileCommentRegex.test(code)) debug$3?.(`Skipped injecting fallback sourcemap for ${req$4.url}`);
|
|
25645
25539
|
else {
|
|
25646
25540
|
const urlWithoutTimestamp = removeTimestampQuery(req$4.url);
|
|
25647
|
-
|
|
25648
|
-
content = getCodeWithSourcemap(type, code, ms.generateMap({
|
|
25541
|
+
content = getCodeWithSourcemap(type, code, new MagicString(code).generateMap({
|
|
25649
25542
|
source: path.basename(urlWithoutTimestamp),
|
|
25650
25543
|
hires: "boundary",
|
|
25651
25544
|
includeContent: true
|
|
@@ -25968,8 +25861,7 @@ function isFileServingAllowed(configOrUrl, urlOrServer) {
|
|
|
25968
25861
|
const config$2 = typeof urlOrServer === "string" ? configOrUrl : urlOrServer.config;
|
|
25969
25862
|
const url$3 = typeof urlOrServer === "string" ? urlOrServer : configOrUrl;
|
|
25970
25863
|
if (!config$2.server.fs.strict) return true;
|
|
25971
|
-
|
|
25972
|
-
return isFileLoadingAllowed(config$2, filePath);
|
|
25864
|
+
return isFileLoadingAllowed(config$2, fsPathFromUrl(url$3));
|
|
25973
25865
|
}
|
|
25974
25866
|
/**
|
|
25975
25867
|
* Warning: parameters are not validated, only works with normalized absolute paths
|
|
@@ -26035,8 +25927,9 @@ const debugCache$1 = createDebugger("vite:cache");
|
|
|
26035
25927
|
function transformRequest(environment, url$3, options$1 = {}) {
|
|
26036
25928
|
if (environment._closing && environment.config.dev.recoverable) throwClosedServerError();
|
|
26037
25929
|
const timestamp = monotonicDateNow();
|
|
25930
|
+
url$3 = removeTimestampQuery(url$3);
|
|
26038
25931
|
const pending = environment._pendingRequests.get(url$3);
|
|
26039
|
-
if (pending) return environment.moduleGraph.getModuleByUrl(
|
|
25932
|
+
if (pending) return environment.moduleGraph.getModuleByUrl(url$3).then((module$1) => {
|
|
26040
25933
|
if (!module$1 || pending.timestamp > module$1.lastInvalidationTimestamp) return pending.request;
|
|
26041
25934
|
else {
|
|
26042
25935
|
pending.abort();
|
|
@@ -26059,7 +25952,6 @@ function transformRequest(environment, url$3, options$1 = {}) {
|
|
|
26059
25952
|
return request.finally(clearCache);
|
|
26060
25953
|
}
|
|
26061
25954
|
async function doTransform(environment, url$3, options$1, timestamp) {
|
|
26062
|
-
url$3 = removeTimestampQuery(url$3);
|
|
26063
25955
|
const { pluginContainer } = environment;
|
|
26064
25956
|
let module$1 = await environment.moduleGraph.getModuleByUrl(url$3);
|
|
26065
25957
|
if (module$1) {
|
|
@@ -26451,16 +26343,15 @@ function traverseNodes(node, visitor) {
|
|
|
26451
26343
|
if (nodeIsElement(node) || node.nodeName === "#document" || node.nodeName === "#document-fragment") node.childNodes.forEach((childNode) => traverseNodes(childNode, visitor));
|
|
26452
26344
|
}
|
|
26453
26345
|
async function traverseHtml(html, filePath, warn, visitor) {
|
|
26454
|
-
const { parse: parse$17 } = await import("./dep-
|
|
26346
|
+
const { parse: parse$17 } = await import("./dep-BRReGxEs.js");
|
|
26455
26347
|
const warnings = {};
|
|
26456
|
-
|
|
26348
|
+
traverseNodes(parse$17(html, {
|
|
26457
26349
|
scriptingEnabled: false,
|
|
26458
26350
|
sourceCodeLocationInfo: true,
|
|
26459
26351
|
onParseError: (e$1) => {
|
|
26460
26352
|
handleParseError(e$1, html, filePath, warnings);
|
|
26461
26353
|
}
|
|
26462
|
-
});
|
|
26463
|
-
traverseNodes(ast, visitor);
|
|
26354
|
+
}), visitor);
|
|
26464
26355
|
for (const message of Object.values(warnings)) warn(import_picocolors$13.default.yellow(`\n${message}`));
|
|
26465
26356
|
}
|
|
26466
26357
|
function getScriptInfo(node) {
|
|
@@ -26611,8 +26502,7 @@ function buildHtmlPlugin(config$2) {
|
|
|
26611
26502
|
shouldRemove = true;
|
|
26612
26503
|
} else if (node.childNodes.length) {
|
|
26613
26504
|
const contents = node.childNodes.pop().value;
|
|
26614
|
-
|
|
26615
|
-
addToHTMLProxyCache(config$2, filePath, inlineModuleIndex, { code: contents });
|
|
26505
|
+
addToHTMLProxyCache(config$2, id.replace(normalizePath(config$2.root), ""), inlineModuleIndex, { code: contents });
|
|
26616
26506
|
js += `\nimport "${id}?html-proxy&index=${inlineModuleIndex}.js"`;
|
|
26617
26507
|
shouldRemove = true;
|
|
26618
26508
|
}
|
|
@@ -26665,8 +26555,7 @@ function buildHtmlPlugin(config$2) {
|
|
|
26665
26555
|
if (inlineStyle) {
|
|
26666
26556
|
inlineModuleIndex++;
|
|
26667
26557
|
const code = inlineStyle.attr.value;
|
|
26668
|
-
|
|
26669
|
-
addToHTMLProxyCache(config$2, filePath, inlineModuleIndex, { code });
|
|
26558
|
+
addToHTMLProxyCache(config$2, id.replace(normalizePath(config$2.root), ""), inlineModuleIndex, { code });
|
|
26670
26559
|
js += `\nimport "${id}?html-proxy&inline-css&style-attr&index=${inlineModuleIndex}.css"`;
|
|
26671
26560
|
const hash$1 = getHash(cleanUrl(id));
|
|
26672
26561
|
overwriteAttrValue(s$2, inlineStyle.location, `__VITE_INLINE_CSS__${hash$1}_${inlineModuleIndex}__`);
|
|
@@ -27470,8 +27359,7 @@ const devHtmlHook = async (html, { path: htmlPath, filename, server, originalUrl
|
|
|
27470
27359
|
ensureWatchedFile(watcher, mod.file, config$2.root);
|
|
27471
27360
|
await server?.environments.client.pluginContainer.transform(code, mod.id);
|
|
27472
27361
|
const hash$1 = getHash(cleanUrl(mod.id));
|
|
27473
|
-
|
|
27474
|
-
overwriteAttrValue(s$2, location$1, result ?? "");
|
|
27362
|
+
overwriteAttrValue(s$2, location$1, htmlProxyResult.get(`${hash$1}_${index}`) ?? "");
|
|
27475
27363
|
})]);
|
|
27476
27364
|
html = s$2.toString();
|
|
27477
27365
|
return {
|
|
@@ -28421,8 +28309,7 @@ function resolveServerOptions(root, raw, logger) {
|
|
|
28421
28309
|
if (process.versions.pnp) {
|
|
28422
28310
|
const cwd = searchForPackageRoot(root);
|
|
28423
28311
|
try {
|
|
28424
|
-
const
|
|
28425
|
-
const yarnCacheDir = execSync(`yarn config get ${enableGlobalCache ? "globalFolder" : "cacheFolder"}`, { cwd }).toString().trim();
|
|
28312
|
+
const yarnCacheDir = execSync(`yarn config get ${execSync("yarn config get enableGlobalCache", { cwd }).toString().trim() === "true" ? "globalFolder" : "cacheFolder"}`, { cwd }).toString().trim();
|
|
28426
28313
|
allowDirs.push(yarnCacheDir);
|
|
28427
28314
|
} catch (e$1) {
|
|
28428
28315
|
logger.warn(`Get yarn cache dir error: ${e$1.message}`, { timestamp: true });
|
|
@@ -29100,10 +28987,9 @@ function definePlugin(config$2) {
|
|
|
29100
28987
|
const patternKeys = Object.keys(userDefine);
|
|
29101
28988
|
if (!keepProcessEnv && Object.keys(processEnv).length) patternKeys.push("process.env");
|
|
29102
28989
|
if (Object.keys(importMetaKeys).length) patternKeys.push("import.meta.env", "import.meta.hot");
|
|
29103
|
-
const pattern = patternKeys.length ? new RegExp(patternKeys.map((key) => escapeRegex(key).replaceAll(escapedDotRE, "\\??\\.")).join("|")) : null;
|
|
29104
28990
|
return [
|
|
29105
28991
|
define$1,
|
|
29106
|
-
|
|
28992
|
+
patternKeys.length ? new RegExp(patternKeys.map((key) => escapeRegex(key).replaceAll(escapedDotRE, "\\??\\.")).join("|")) : null,
|
|
29107
28993
|
importMetaEnvVal
|
|
29108
28994
|
];
|
|
29109
28995
|
}
|
|
@@ -29233,8 +29119,7 @@ async function bundleWorkerEntry(config$2, id) {
|
|
|
29233
29119
|
if (config$2.bundleChain.includes(input)) throw new Error(`Circular worker imports detected. Vite does not support it. Import chain: ${newBundleChain.map((id$1) => prettifyUrl(id$1, config$2.root)).join(" -> ")}`);
|
|
29234
29120
|
const { rollup } = await import("rollup");
|
|
29235
29121
|
const { plugins: plugins$1, rollupOptions, format: format$3 } = config$2.worker;
|
|
29236
|
-
const
|
|
29237
|
-
const workerEnvironment = new BuildEnvironment("client", workerConfig);
|
|
29122
|
+
const workerEnvironment = new BuildEnvironment("client", await plugins$1(newBundleChain));
|
|
29238
29123
|
await workerEnvironment.init();
|
|
29239
29124
|
const bundle = await rollup({
|
|
29240
29125
|
...rollupOptions,
|
|
@@ -29248,12 +29133,12 @@ async function bundleWorkerEntry(config$2, id) {
|
|
|
29248
29133
|
let chunk;
|
|
29249
29134
|
try {
|
|
29250
29135
|
const workerOutputConfig = config$2.worker.rollupOptions.output;
|
|
29251
|
-
const workerConfig
|
|
29136
|
+
const workerConfig = workerOutputConfig ? Array.isArray(workerOutputConfig) ? workerOutputConfig[0] || {} : workerOutputConfig : {};
|
|
29252
29137
|
const { output: [outputChunk, ...outputChunks] } = await bundle.generate({
|
|
29253
29138
|
entryFileNames: path.posix.join(config$2.build.assetsDir, "[name]-[hash].js"),
|
|
29254
29139
|
chunkFileNames: path.posix.join(config$2.build.assetsDir, "[name]-[hash].js"),
|
|
29255
29140
|
assetFileNames: path.posix.join(config$2.build.assetsDir, "[name]-[hash].[ext]"),
|
|
29256
|
-
...workerConfig
|
|
29141
|
+
...workerConfig,
|
|
29257
29142
|
format: format$3,
|
|
29258
29143
|
sourcemap: config$2.build.sourcemap
|
|
29259
29144
|
});
|
|
@@ -29280,9 +29165,8 @@ function emitSourcemapForWorkerEntry(config$2, chunk) {
|
|
|
29280
29165
|
if (sourcemap) {
|
|
29281
29166
|
if (config$2.build.sourcemap === "hidden" || config$2.build.sourcemap === true) {
|
|
29282
29167
|
const data = sourcemap.toString();
|
|
29283
|
-
const mapFileName = chunk.fileName + ".map";
|
|
29284
29168
|
saveEmitWorkerAsset(config$2, {
|
|
29285
|
-
fileName:
|
|
29169
|
+
fileName: chunk.fileName + ".map",
|
|
29286
29170
|
originalFileName: null,
|
|
29287
29171
|
originalFileNames: [],
|
|
29288
29172
|
source: data
|
|
@@ -29581,15 +29465,14 @@ function extractImportedBindings(id, source, importSpec, importedBindings) {
|
|
|
29581
29465
|
ESM_STATIC_IMPORT_RE.lastIndex = 0;
|
|
29582
29466
|
const match = ESM_STATIC_IMPORT_RE.exec(exp);
|
|
29583
29467
|
if (!match) return;
|
|
29584
|
-
const
|
|
29468
|
+
const parsed = parseStaticImport({
|
|
29585
29469
|
type: "static",
|
|
29586
29470
|
code: match[0],
|
|
29587
29471
|
start: match.index,
|
|
29588
29472
|
end: match.index + match[0].length,
|
|
29589
29473
|
imports: match.groups.imports,
|
|
29590
29474
|
specifier: match.groups.specifier
|
|
29591
|
-
};
|
|
29592
|
-
const parsed = parseStaticImport(staticImport);
|
|
29475
|
+
});
|
|
29593
29476
|
if (parsed.namespacedImport) bindings.add("*");
|
|
29594
29477
|
if (parsed.defaultImport) bindings.add("default");
|
|
29595
29478
|
if (parsed.namedImports) for (const name of Object.keys(parsed.namedImports)) bindings.add(name);
|
|
@@ -29754,7 +29637,7 @@ function importAnalysisPlugin(config$2) {
|
|
|
29754
29637
|
const isDynamicImport = dynamicIndex > -1;
|
|
29755
29638
|
if (!isDynamicImport && attributeIndex > -1) str().remove(end + 1, expEnd);
|
|
29756
29639
|
if (specifier !== void 0) {
|
|
29757
|
-
if (isExternalUrl(specifier) && !specifier.startsWith("file://") || isDataUrl(specifier)) return;
|
|
29640
|
+
if ((isExternalUrl(specifier) && !specifier.startsWith("file://") || isDataUrl(specifier)) && !matchAlias(specifier)) return;
|
|
29758
29641
|
if (ssr && !matchAlias(specifier)) {
|
|
29759
29642
|
if (shouldExternalize(environment, specifier, importer)) return;
|
|
29760
29643
|
if (isBuiltin(environment.config.resolve.builtins, specifier)) return;
|
|
@@ -29888,8 +29771,7 @@ function interopNamedImports(str, importSpecifier, rewrittenUrl, importIndex, im
|
|
|
29888
29771
|
const exp = source.slice(expStart, expEnd);
|
|
29889
29772
|
if (dynamicIndex > -1) str.overwrite(expStart, expEnd, `import('${rewrittenUrl}').then(m => (${interopHelperStr})(m.default))` + getLineBreaks(exp), { contentOnly: true });
|
|
29890
29773
|
else {
|
|
29891
|
-
const
|
|
29892
|
-
const rewritten = transformCjsImport(exp, rewrittenUrl, rawUrl, importIndex, importer, config$2);
|
|
29774
|
+
const rewritten = transformCjsImport(exp, rewrittenUrl, source.slice(start, end), importIndex, importer, config$2);
|
|
29893
29775
|
if (rewritten) str.overwrite(expStart, expEnd, rewritten + getLineBreaks(exp), { contentOnly: true });
|
|
29894
29776
|
else str.overwrite(start, end, rewrittenUrl + getLineBreaks(source.slice(start, end)), { contentOnly: true });
|
|
29895
29777
|
}
|
|
@@ -30567,8 +30449,7 @@ function dynamicImportVarsPlugin(config$2) {
|
|
|
30567
30449
|
//#region src/node/plugins/pluginFilter.ts
|
|
30568
30450
|
function getMatcherString(glob$1, cwd) {
|
|
30569
30451
|
if (glob$1.startsWith("**") || path.isAbsolute(glob$1)) return slash(glob$1);
|
|
30570
|
-
|
|
30571
|
-
return slash(resolved);
|
|
30452
|
+
return slash(path.join(cwd, glob$1));
|
|
30572
30453
|
}
|
|
30573
30454
|
function patternToIdFilter(pattern, cwd) {
|
|
30574
30455
|
if (pattern instanceof RegExp) return (id) => {
|
|
@@ -30577,11 +30458,9 @@ function patternToIdFilter(pattern, cwd) {
|
|
|
30577
30458
|
pattern.lastIndex = 0;
|
|
30578
30459
|
return result;
|
|
30579
30460
|
};
|
|
30580
|
-
const
|
|
30581
|
-
const matcher = picomatch(glob$1, { dot: true });
|
|
30461
|
+
const matcher = picomatch(getMatcherString(pattern, cwd), { dot: true });
|
|
30582
30462
|
return (id) => {
|
|
30583
|
-
|
|
30584
|
-
return matcher(normalizedId);
|
|
30463
|
+
return matcher(slash(id));
|
|
30585
30464
|
};
|
|
30586
30465
|
}
|
|
30587
30466
|
function patternToCodeFilter(pattern) {
|
|
@@ -30640,7 +30519,7 @@ function createFilterForTransform(idFilter, codeFilter, cwd) {
|
|
|
30640
30519
|
async function resolvePlugins(config$2, prePlugins, normalPlugins, postPlugins) {
|
|
30641
30520
|
const isBuild = config$2.command === "build";
|
|
30642
30521
|
const isWorker = config$2.isWorker;
|
|
30643
|
-
const buildPlugins = isBuild ? await (await import("./dep-
|
|
30522
|
+
const buildPlugins = isBuild ? await (await import("./dep-B6cO9KC8.js")).resolveBuildPlugins(config$2) : {
|
|
30644
30523
|
pre: [],
|
|
30645
30524
|
post: []
|
|
30646
30525
|
};
|
|
@@ -31265,8 +31144,7 @@ var PluginContext = class extends MinimalPluginContext {
|
|
|
31265
31144
|
if (this instanceof TransformPluginContext && typeof err$2.loc?.line === "number" && typeof err$2.loc.column === "number") {
|
|
31266
31145
|
const rawSourceMap = this._getCombinedSourcemap();
|
|
31267
31146
|
if (rawSourceMap && "version" in rawSourceMap) {
|
|
31268
|
-
const
|
|
31269
|
-
const { source, line, column } = originalPositionFor(traced, {
|
|
31147
|
+
const { source, line, column } = originalPositionFor(new TraceMap(rawSourceMap), {
|
|
31270
31148
|
line: Number(err$2.loc.line),
|
|
31271
31149
|
column: Number(err$2.loc.column)
|
|
31272
31150
|
});
|
|
@@ -31879,7 +31757,7 @@ function cssPostPlugin(config$2) {
|
|
|
31879
31757
|
},
|
|
31880
31758
|
async generateBundle(opts, bundle) {
|
|
31881
31759
|
if (opts.__vite_skip_asset_emit__) return;
|
|
31882
|
-
if (!this.environment.config.build.cssCodeSplit && !hasEmitted) {
|
|
31760
|
+
if ((config$2.command !== "build" || this.environment.config.build.emitAssets) && !this.environment.config.build.cssCodeSplit && !hasEmitted) {
|
|
31883
31761
|
let extractedCss = "";
|
|
31884
31762
|
const collected = /* @__PURE__ */ new Set();
|
|
31885
31763
|
const dynamicImports = /* @__PURE__ */ new Set();
|
|
@@ -32216,8 +32094,7 @@ async function runPostCSS(id, code, plugins$1, options$1, deps, logger, enableSo
|
|
|
32216
32094
|
code: postcssResult.css,
|
|
32217
32095
|
map: { mappings: "" }
|
|
32218
32096
|
};
|
|
32219
|
-
const
|
|
32220
|
-
const postcssMap = await formatPostcssSourceMap(rawPostcssMap, cleanUrl(id));
|
|
32097
|
+
const postcssMap = await formatPostcssSourceMap(postcssResult.map.toJSON(), cleanUrl(id));
|
|
32221
32098
|
return {
|
|
32222
32099
|
code: postcssResult.css,
|
|
32223
32100
|
map: postcssMap
|
|
@@ -32234,7 +32111,7 @@ function createCachedImport(imp) {
|
|
|
32234
32111
|
};
|
|
32235
32112
|
}
|
|
32236
32113
|
const importPostcssImport = createCachedImport(() => import("./dep-CwrJo3zV.js").then(__toDynamicImportESM(1)));
|
|
32237
|
-
const importPostcssModules = createCachedImport(() => import("./dep-
|
|
32114
|
+
const importPostcssModules = createCachedImport(() => import("./dep-B0biTXWL.js").then(__toDynamicImportESM(1)));
|
|
32238
32115
|
const importPostcss = createCachedImport(() => import("postcss"));
|
|
32239
32116
|
const preprocessorWorkerControllerCache = /* @__PURE__ */ new WeakMap();
|
|
32240
32117
|
let alwaysFakeWorkerWorkerControllerCache;
|
|
@@ -32247,8 +32124,7 @@ async function preprocessCSS(code, filename, config$2) {
|
|
|
32247
32124
|
alwaysFakeWorkerWorkerControllerCache ||= createPreprocessorWorkerController(0);
|
|
32248
32125
|
workerController = alwaysFakeWorkerWorkerControllerCache;
|
|
32249
32126
|
}
|
|
32250
|
-
|
|
32251
|
-
return await compileCSS(environment, filename, code, workerController);
|
|
32127
|
+
return await compileCSS(new PartialEnvironment("client", config$2), filename, code, workerController);
|
|
32252
32128
|
}
|
|
32253
32129
|
async function formatPostcssSourceMap(rawMap, file) {
|
|
32254
32130
|
const inputFileDir = path.dirname(file);
|
|
@@ -32292,8 +32168,7 @@ async function resolvePostcssConfig(config$2) {
|
|
|
32292
32168
|
};
|
|
32293
32169
|
} else {
|
|
32294
32170
|
const searchPath = typeof inlineOptions === "string" ? inlineOptions : config$2.root;
|
|
32295
|
-
|
|
32296
|
-
result = (0, import_src.default)({}, searchPath, { stopDir }).catch((e$1) => {
|
|
32171
|
+
result = (0, import_src.default)({}, searchPath, { stopDir: searchForWorkspaceRoot(config$2.root) }).catch((e$1) => {
|
|
32297
32172
|
if (!e$1.message.includes("No PostCSS Config found")) if (e$1 instanceof Error) {
|
|
32298
32173
|
const { name, message, stack } = e$1;
|
|
32299
32174
|
e$1.name = "Failed to load PostCSS config";
|
|
@@ -32660,8 +32535,7 @@ async function rebaseUrls(environment, file, rootFile, resolver$1, ignoreUrl) {
|
|
|
32660
32535
|
if (ignoreUrl?.(unquotedUrl, rawUrl)) return false;
|
|
32661
32536
|
if (unquotedUrl[0] === "/") return unquotedUrl;
|
|
32662
32537
|
const absolute = await resolver$1(environment, unquotedUrl, file) || path.resolve(fileDir, unquotedUrl);
|
|
32663
|
-
|
|
32664
|
-
return normalizePath(relative$3);
|
|
32538
|
+
return normalizePath(path.relative(rootDir, absolute));
|
|
32665
32539
|
};
|
|
32666
32540
|
if (hasImportCss) rebased = await rewriteImportCss(content, rebaseFn);
|
|
32667
32541
|
if (hasUrls) rebased = await rewriteCssUrls(rebased || content, rebaseFn);
|
|
@@ -32986,8 +32860,7 @@ async function compileLightningCSS(environment, id, src, deps, workerController,
|
|
|
32986
32860
|
column: e$1.loc.column - 1
|
|
32987
32861
|
};
|
|
32988
32862
|
try {
|
|
32989
|
-
const
|
|
32990
|
-
const friendlyMessage = getLightningCssErrorMessageForIeSyntaxes(code);
|
|
32863
|
+
const friendlyMessage = getLightningCssErrorMessageForIeSyntaxes(fs.readFileSync(e$1.fileName, "utf-8"));
|
|
32991
32864
|
if (friendlyMessage) e$1.message += friendlyMessage;
|
|
32992
32865
|
} catch {}
|
|
32993
32866
|
}
|
|
@@ -33242,9 +33115,7 @@ function preload(baseModule, deps, importerUrl) {
|
|
|
33242
33115
|
}
|
|
33243
33116
|
function getPreloadCode(environment, renderBuiltUrlBoolean, isRelativeBase) {
|
|
33244
33117
|
const { modulePreload } = environment.config.build;
|
|
33245
|
-
const scriptRel
|
|
33246
|
-
const assetsURL$1 = renderBuiltUrlBoolean || isRelativeBase ? `function(dep, importerUrl) { return new URL(dep, importerUrl).href }` : `function(dep) { return ${JSON.stringify(environment.config.base)}+dep }`;
|
|
33247
|
-
return `const scriptRel = ${scriptRel$1};const assetsURL = ${assetsURL$1};const seen = {};export const ${preloadMethod} = ${preload.toString()}`;
|
|
33118
|
+
return `const scriptRel = ${modulePreload && modulePreload.polyfill ? `'modulepreload'` : `/* @__PURE__ */ (${detectScriptRel.toString()})()`};const assetsURL = ${renderBuiltUrlBoolean || isRelativeBase ? `function(dep, importerUrl) { return new URL(dep, importerUrl).href }` : `function(dep) { return ${JSON.stringify(environment.config.base)}+dep }`};const seen = {};export const ${preloadMethod} = ${preload.toString()}`;
|
|
33248
33119
|
}
|
|
33249
33120
|
/**
|
|
33250
33121
|
* Build only. During serve this is performed as part of ./importAnalysis.
|
|
@@ -33507,8 +33378,10 @@ function buildImportAnalysisPlugin(config$2) {
|
|
|
33507
33378
|
source: chunk.fileName,
|
|
33508
33379
|
hires: "boundary"
|
|
33509
33380
|
});
|
|
33381
|
+
const originalFile = chunk.map.file;
|
|
33510
33382
|
const map$1 = combineSourcemaps(chunk.fileName, [nextMap, chunk.map]);
|
|
33511
33383
|
map$1.toUrl = () => genSourceMapUrl(map$1);
|
|
33384
|
+
if (originalFile) map$1.file = originalFile;
|
|
33512
33385
|
const originalDebugId = chunk.map.debugId;
|
|
33513
33386
|
chunk.map = map$1;
|
|
33514
33387
|
if (buildSourcemap === "inline") {
|
|
@@ -33597,8 +33470,7 @@ function ssrManifestPlugin() {
|
|
|
33597
33470
|
chunk$1.imports.forEach(addDeps);
|
|
33598
33471
|
}
|
|
33599
33472
|
};
|
|
33600
|
-
|
|
33601
|
-
addDeps(normalizedFile);
|
|
33473
|
+
addDeps(normalizePath(join(dirname(chunk.fileName), url$3.slice(1, -1))));
|
|
33602
33474
|
ssrManifest[basename(name)] = deps;
|
|
33603
33475
|
}
|
|
33604
33476
|
}
|
|
@@ -33673,8 +33545,7 @@ function prepareOutDirPlugin() {
|
|
|
33673
33545
|
if (config$2.build.write) {
|
|
33674
33546
|
const { root, build: options$1 } = config$2;
|
|
33675
33547
|
const resolvedOutDirs = getResolvedOutDirs(root, options$1.outDir, options$1.rollupOptions.output);
|
|
33676
|
-
|
|
33677
|
-
prepareOutDir(resolvedOutDirs, emptyOutDir, this.environment);
|
|
33548
|
+
prepareOutDir(resolvedOutDirs, resolveEmptyOutDir(options$1.emptyOutDir, root, resolvedOutDirs, this.environment.logger), this.environment);
|
|
33678
33549
|
}
|
|
33679
33550
|
}
|
|
33680
33551
|
}
|
|
@@ -33684,14 +33555,11 @@ function prepareOutDir(outDirs, emptyOutDir, environment) {
|
|
|
33684
33555
|
const { publicDir } = environment.config;
|
|
33685
33556
|
const outDirsArray = [...outDirs];
|
|
33686
33557
|
for (const outDir of outDirs) {
|
|
33687
|
-
if (emptyOutDir !== false && fs.existsSync(outDir)) {
|
|
33688
|
-
const
|
|
33689
|
-
|
|
33690
|
-
|
|
33691
|
-
|
|
33692
|
-
}).filter(Boolean);
|
|
33693
|
-
emptyDir(outDir, [...skipDirs, ".git"]);
|
|
33694
|
-
}
|
|
33558
|
+
if (emptyOutDir !== false && fs.existsSync(outDir)) emptyDir(outDir, [...outDirsArray.map((dir) => {
|
|
33559
|
+
const relative$3 = path.relative(outDir, dir);
|
|
33560
|
+
if (relative$3 && !relative$3.startsWith("..") && !path.isAbsolute(relative$3)) return relative$3;
|
|
33561
|
+
return "";
|
|
33562
|
+
}).filter(Boolean), ".git"]);
|
|
33695
33563
|
if (environment.config.build.copyPublicDir && publicDir && fs.existsSync(publicDir)) {
|
|
33696
33564
|
if (!areSeparateFolders(outDir, publicDir)) environment.logger.warn(import_picocolors$5.default.yellow(`\n${import_picocolors$5.default.bold(`(!)`)} The public directory feature may not work correctly. outDir ${import_picocolors$5.default.white(import_picocolors$5.default.dim(outDir))} and publicDir ${import_picocolors$5.default.white(import_picocolors$5.default.dim(publicDir))} are not separate folders.\n`));
|
|
33697
33565
|
copyDir(publicDir, outDir);
|
|
@@ -34020,10 +33888,8 @@ function onRollupLog(level, log$4, environment) {
|
|
|
34020
33888
|
clearLine();
|
|
34021
33889
|
const userOnLog = environment.config.build.rollupOptions?.onLog;
|
|
34022
33890
|
const userOnWarn = environment.config.build.rollupOptions?.onwarn;
|
|
34023
|
-
if (userOnLog) if (userOnWarn)
|
|
34024
|
-
|
|
34025
|
-
userOnLog(level, log$4, normalizedUserOnWarn);
|
|
34026
|
-
} else userOnLog(level, log$4, viteLog);
|
|
33891
|
+
if (userOnLog) if (userOnWarn) userOnLog(level, log$4, normalizeUserOnWarn(userOnWarn, viteLog));
|
|
33892
|
+
else userOnLog(level, log$4, viteLog);
|
|
34027
33893
|
else if (userOnWarn) normalizeUserOnWarn(userOnWarn, viteLog)(level, log$4);
|
|
34028
33894
|
else viteLog(level, log$4);
|
|
34029
33895
|
}
|
|
@@ -34339,11 +34205,9 @@ async function fetchModule(environment, url$3, importer, options$1 = {}) {
|
|
|
34339
34205
|
err$2.code = "ERR_MODULE_NOT_FOUND";
|
|
34340
34206
|
throw err$2;
|
|
34341
34207
|
}
|
|
34342
|
-
const file = pathToFileURL(resolved.id).toString();
|
|
34343
|
-
const type = isFilePathESM(resolved.id, environment.config.packageCache) ? "module" : "commonjs";
|
|
34344
34208
|
return {
|
|
34345
|
-
externalize:
|
|
34346
|
-
type
|
|
34209
|
+
externalize: pathToFileURL(resolved.id).toString(),
|
|
34210
|
+
type: isFilePathESM(resolved.id, environment.config.packageCache) ? "module" : "commonjs"
|
|
34347
34211
|
};
|
|
34348
34212
|
}
|
|
34349
34213
|
url$3 = unwrapId(url$3);
|
|
@@ -35228,8 +35092,7 @@ function invalidateModule(environment, m$2) {
|
|
|
35228
35092
|
if (mod && mod.isSelfAccepting && mod.lastHMRTimestamp > 0 && !mod.lastHMRInvalidationReceived) {
|
|
35229
35093
|
mod.lastHMRInvalidationReceived = true;
|
|
35230
35094
|
environment.logger.info(import_picocolors$1.default.yellow(`hmr invalidate `) + import_picocolors$1.default.dim(m$2.path) + (m$2.message ? ` ${m$2.message}` : ""), { timestamp: true });
|
|
35231
|
-
|
|
35232
|
-
updateModules(environment, file, [...mod.importers], mod.lastHMRTimestamp, m$2.firstInvalidatedBy);
|
|
35095
|
+
updateModules(environment, getShortName(mod.file, environment.config.root), [...mod.importers], mod.lastHMRTimestamp, m$2.firstInvalidatedBy);
|
|
35233
35096
|
}
|
|
35234
35097
|
}
|
|
35235
35098
|
const callCrawlEndIfIdleAfterMs = 50;
|
|
@@ -35499,10 +35362,7 @@ async function preview(inlineConfig = {}) {
|
|
|
35499
35362
|
server.resolvedUrls = resolveServerUrls(httpServer, config$2.preview, hostname, httpsOptions, config$2);
|
|
35500
35363
|
if (options$1.open) {
|
|
35501
35364
|
const url$3 = getServerUrlByHost(server.resolvedUrls, options$1.host);
|
|
35502
|
-
if (url$3)
|
|
35503
|
-
const path$13 = typeof options$1.open === "string" ? new URL(options$1.open, url$3).href : url$3;
|
|
35504
|
-
openBrowser(path$13, true, logger);
|
|
35505
|
-
}
|
|
35365
|
+
if (url$3) openBrowser(typeof options$1.open === "string" ? new URL(options$1.open, url$3).href : url$3, true, logger);
|
|
35506
35366
|
}
|
|
35507
35367
|
return server;
|
|
35508
35368
|
}
|
|
@@ -35514,8 +35374,7 @@ const ssrConfigDefaults = Object.freeze({
|
|
|
35514
35374
|
optimizeDeps: {}
|
|
35515
35375
|
});
|
|
35516
35376
|
function resolveSSROptions(ssr, preserveSymlinks) {
|
|
35517
|
-
|
|
35518
|
-
return mergeWithDefaults(defaults, ssr ?? {});
|
|
35377
|
+
return mergeWithDefaults(mergeWithDefaults(ssrConfigDefaults, { optimizeDeps: { esbuildOptions: { preserveSymlinks } } }), ssr ?? {});
|
|
35519
35378
|
}
|
|
35520
35379
|
|
|
35521
35380
|
//#endregion
|
|
@@ -35526,7 +35385,7 @@ function resolveSSROptions(ssr, preserveSymlinks) {
|
|
|
35526
35385
|
*/
|
|
35527
35386
|
async function runnerImport(moduleId, inlineConfig) {
|
|
35528
35387
|
const isModuleSyncConditionEnabled = (await import("#module-sync-enabled")).default;
|
|
35529
|
-
const
|
|
35388
|
+
const environment = createRunnableDevEnvironment("inline", await resolveConfig(mergeConfig(inlineConfig || {}, {
|
|
35530
35389
|
configFile: false,
|
|
35531
35390
|
envDir: false,
|
|
35532
35391
|
cacheDir: process.cwd(),
|
|
@@ -35539,21 +35398,19 @@ async function runnerImport(moduleId, inlineConfig) {
|
|
|
35539
35398
|
conditions: ["node", ...isModuleSyncConditionEnabled ? ["module-sync"] : []]
|
|
35540
35399
|
}
|
|
35541
35400
|
} }
|
|
35542
|
-
}), "serve")
|
|
35543
|
-
const environment = createRunnableDevEnvironment("inline", config$2, {
|
|
35401
|
+
}), "serve"), {
|
|
35544
35402
|
runnerOptions: { hmr: { logger: false } },
|
|
35545
35403
|
hot: false
|
|
35546
35404
|
});
|
|
35547
35405
|
await environment.init();
|
|
35548
35406
|
try {
|
|
35549
35407
|
const module$1 = await environment.runner.import(moduleId);
|
|
35550
|
-
const dependencies = [...environment.runner.evaluatedModules.urlToIdModuleMap.values()].filter((m$2) => {
|
|
35551
|
-
if (!m$2.meta || "externalize" in m$2.meta) return false;
|
|
35552
|
-
return m$2.exports !== module$1;
|
|
35553
|
-
}).map((m$2) => m$2.file);
|
|
35554
35408
|
return {
|
|
35555
35409
|
module: module$1,
|
|
35556
|
-
dependencies
|
|
35410
|
+
dependencies: [...environment.runner.evaluatedModules.urlToIdModuleMap.values()].filter((m$2) => {
|
|
35411
|
+
if (!m$2.meta || "externalize" in m$2.meta) return false;
|
|
35412
|
+
return m$2.exports !== module$1;
|
|
35413
|
+
}).map((m$2) => m$2.file)
|
|
35557
35414
|
};
|
|
35558
35415
|
} finally {
|
|
35559
35416
|
await environment.close();
|
|
@@ -35789,8 +35646,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
|
35789
35646
|
}, configEnv);
|
|
35790
35647
|
else return p.apply === command;
|
|
35791
35648
|
};
|
|
35792
|
-
const
|
|
35793
|
-
const [prePlugins, normalPlugins, postPlugins] = sortUserPlugins(rawPlugins);
|
|
35649
|
+
const [prePlugins, normalPlugins, postPlugins] = sortUserPlugins((await asyncFlatten(config$2.plugins || [])).filter(filterPlugin));
|
|
35794
35650
|
const isBuild = command === "build";
|
|
35795
35651
|
const userPlugins = [
|
|
35796
35652
|
...prePlugins,
|
|
@@ -35869,7 +35725,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
|
35869
35725
|
const backwardCompatibleOptimizeDeps = resolvedEnvironments.client.optimizeDeps;
|
|
35870
35726
|
const resolvedDevEnvironmentOptions = resolveDevEnvironmentOptions(config$2.dev, void 0, void 0);
|
|
35871
35727
|
const resolvedBuildOptions = resolveBuildEnvironmentOptions(config$2.build ?? {}, logger, void 0);
|
|
35872
|
-
const
|
|
35728
|
+
const ssr = resolveSSROptions({
|
|
35873
35729
|
...config$2.ssr,
|
|
35874
35730
|
external: resolvedEnvironments.ssr?.resolve.external,
|
|
35875
35731
|
noExternal: resolvedEnvironments.ssr?.resolve.noExternal,
|
|
@@ -35879,8 +35735,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
|
35879
35735
|
conditions: resolvedEnvironments.ssr?.resolve.conditions,
|
|
35880
35736
|
externalConditions: resolvedEnvironments.ssr?.resolve.externalConditions
|
|
35881
35737
|
}
|
|
35882
|
-
};
|
|
35883
|
-
const ssr = resolveSSROptions(patchedConfigSsr, resolvedDefaultResolve.preserveSymlinks);
|
|
35738
|
+
}, resolvedDefaultResolve.preserveSymlinks);
|
|
35884
35739
|
let envDir = config$2.envFile === false ? false : config$2.envDir;
|
|
35885
35740
|
if (envDir !== false) envDir = config$2.envDir ? normalizePath(path.resolve(resolvedRoot, config$2.envDir)) : resolvedRoot;
|
|
35886
35741
|
const userEnv = loadEnv(mode, envDir, resolveEnvPrefix(config$2));
|
|
@@ -36290,11 +36145,10 @@ async function loadConfigFromBundledFile(fileName, bundledCode, isESM) {
|
|
|
36290
36145
|
}
|
|
36291
36146
|
async function runConfigHook(config$2, plugins$1, configEnv) {
|
|
36292
36147
|
let conf = config$2;
|
|
36293
|
-
const
|
|
36148
|
+
const context = new BasicMinimalPluginContext(basePluginContextMeta, createLogger(config$2.logLevel, {
|
|
36294
36149
|
allowClearScreen: config$2.clearScreen,
|
|
36295
36150
|
customLogger: config$2.customLogger
|
|
36296
|
-
});
|
|
36297
|
-
const context = new BasicMinimalPluginContext(basePluginContextMeta, tempLogger);
|
|
36151
|
+
}));
|
|
36298
36152
|
for (const p of getSortedPluginsByHook("config", plugins$1)) {
|
|
36299
36153
|
const hook = p.config;
|
|
36300
36154
|
const res = await getHookHandler(hook).call(context, conf, configEnv);
|