@voidzero-dev/vite-plus-core 0.1.3 → 0.1.5-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rolldown/cli.mjs +617 -184
- package/dist/rolldown/config.d.mts +1 -1
- package/dist/rolldown/config.mjs +8 -8
- package/dist/rolldown/experimental-index.d.mts +2 -2
- package/dist/rolldown/experimental-index.mjs +8 -8
- package/dist/rolldown/filter-index.d.mts +1 -1
- package/dist/rolldown/index.d.mts +1 -1
- package/dist/rolldown/index.mjs +8 -8
- package/dist/rolldown/parallel-plugin-worker.mjs +5 -5
- package/dist/rolldown/parallel-plugin.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.mjs +2 -2
- package/dist/rolldown/plugins-index.d.mts +2 -2
- package/dist/rolldown/plugins-index.mjs +3 -3
- package/dist/rolldown/shared/{bindingify-input-options-DdW_FOGG.mjs → bindingify-input-options-DkwIzK4F.mjs} +6 -3
- package/dist/rolldown/shared/{constructors-ColrbLxz.d.mts → constructors-Bnr_ApVf.d.mts} +1 -1
- package/dist/rolldown/shared/{constructors-CQlws1EK.mjs → constructors-D91FHkmz.mjs} +1 -1
- package/dist/rolldown/shared/{define-config-BqZZMLjO.d.mts → define-config-B1jccsL9.d.mts} +18 -0
- package/dist/rolldown/shared/{error-FTNambir.mjs → error-tpgdcGrK.mjs} +1 -1
- package/dist/rolldown/shared/{load-config-DBRCgd9m.mjs → load-config-Dapgaecf.mjs} +1 -1
- package/dist/rolldown/shared/{normalize-string-or-regex-CJTjKt5t.mjs → normalize-string-or-regex-BCllTl21.mjs} +1 -1
- package/dist/rolldown/shared/{parse-q7gzDQmi.mjs → parse-DFYpKkKl.mjs} +1 -1
- package/dist/rolldown/shared/{rolldown-BJMdRJb1.mjs → rolldown-DK6iIJl8.mjs} +1 -1
- package/dist/rolldown/shared/{rolldown-build-DKv2K096.mjs → rolldown-build-rw0HCMhn.mjs} +9 -6
- package/dist/rolldown/shared/{transform-CQppMqL8.mjs → transform-BSCulZAO.mjs} +2 -2
- package/dist/rolldown/shared/{watch-BeMWbIuq.mjs → watch-D8uEZyLj.mjs} +4 -4
- package/dist/rolldown/utils-index.mjs +4 -4
- package/dist/tsdown/{build-TmLngPCw-CBoVPzkZ.js → build-BG-XbM6V-hoyhQqI3.js} +41 -153
- package/dist/tsdown/build-DHPfiKA--CvTonTfC.js +5 -0
- package/dist/tsdown/{debug-tOJ_PtrM-C-Do1Twv.js → debug-C4FmgzkJ-B6m_gRpz.js} +2 -2
- package/dist/tsdown/{detect-DK-FDZQ9-CHuRhyUG.js → detect-J1_Vd1yf-BWDiPZkP.js} +1 -1
- package/dist/tsdown/{dist-DCol2bGA.js → dist-C9Oecl0H.js} +2 -2
- package/dist/tsdown/{dist-Ba2DZx1w.js → dist-Dx-jtFHM.js} +2 -4
- package/dist/tsdown/{index-node-Djp92Gzb-B-AUHI4t.js → index-node-Bpsmc0eX-jMz9gD3P.js} +1 -1
- package/dist/tsdown/index-types.d.ts +8556 -176
- package/dist/tsdown/index.js +5 -5
- package/dist/tsdown/{main-DYgM-9Cb.js → main-DN-_H9u2.js} +3 -3
- package/dist/tsdown/run.js +3 -3
- package/dist/tsdown/{tsc-CberiTDq.js → tsc-OwK9UHsV.js} +1 -1
- package/dist/vite/client/client.mjs +112 -0
- package/dist/vite/node/chunks/logger.js +1 -1
- package/dist/vite/node/chunks/node.js +823 -494
- package/dist/vite/node/cli.js +201 -63
- package/dist/vite/node/index.d.ts +15 -12
- package/dist/vite/node/index.js +1 -1
- package/dist/vite/node/module-runner.d.ts +5 -1
- package/dist/vite/types/customEvent.d.ts +27 -0
- package/package.json +9 -9
- package/dist/tsdown/build-gOkJM1H9-D9ngUBpk.js +0 -5
- /package/dist/rolldown/shared/{binding-COZdHtee.mjs → binding-BSVL02lq.mjs} +0 -0
- /package/dist/tsdown/{filename-BDcjeHGl.js → filename-tIvGuRvQ.js} +0 -0
|
@@ -21,7 +21,6 @@ import { isatty } from "node:tty";
|
|
|
21
21
|
import path$1, { basename as basename$1, dirname as dirname$1, isAbsolute as isAbsolute$1, join as join$1, normalize as normalize$1, posix as posix$1, relative as relative$1, resolve as resolve$1, sep as sep$1, win32 } from "path";
|
|
22
22
|
import { exactRegex, makeIdFiltersToMatchWithQuery, prefixRegex, withFilter } from "@voidzero-dev/vite-plus-core/rolldown/filter";
|
|
23
23
|
import { dev, resolveTsconfig, scan, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteDynamicImportVarsPlugin, viteImportGlobPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWasmFallbackPlugin, viteWebWorkerPostPlugin } from "@voidzero-dev/vite-plus-core/rolldown/experimental";
|
|
24
|
-
import { gzip } from "node:zlib";
|
|
25
24
|
import readline from "node:readline";
|
|
26
25
|
import { MessageChannel, Worker } from "node:worker_threads";
|
|
27
26
|
import isModuleSyncConditionEnabled from "#module-sync-enabled";
|
|
@@ -1830,22 +1829,22 @@ const importMetaResolveWithCustomHookString = `
|
|
|
1830
1829
|
`;
|
|
1831
1830
|
//#endregion
|
|
1832
1831
|
//#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
1833
|
-
var comma = ",".charCodeAt(0);
|
|
1832
|
+
var comma$1 = ",".charCodeAt(0);
|
|
1834
1833
|
var semicolon = ";".charCodeAt(0);
|
|
1835
|
-
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1836
|
-
var intToChar = new Uint8Array(64);
|
|
1837
|
-
var charToInt = new Uint8Array(128);
|
|
1838
|
-
for (let i = 0; i < chars.length; i++) {
|
|
1839
|
-
const c = chars.charCodeAt(i);
|
|
1840
|
-
intToChar[i] = c;
|
|
1841
|
-
charToInt[c] = i;
|
|
1842
|
-
}
|
|
1843
|
-
function decodeInteger(reader, relative) {
|
|
1834
|
+
var chars$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1835
|
+
var intToChar$1 = new Uint8Array(64);
|
|
1836
|
+
var charToInt$1 = new Uint8Array(128);
|
|
1837
|
+
for (let i = 0; i < chars$1.length; i++) {
|
|
1838
|
+
const c = chars$1.charCodeAt(i);
|
|
1839
|
+
intToChar$1[i] = c;
|
|
1840
|
+
charToInt$1[c] = i;
|
|
1841
|
+
}
|
|
1842
|
+
function decodeInteger$1(reader, relative) {
|
|
1844
1843
|
let value = 0;
|
|
1845
1844
|
let shift = 0;
|
|
1846
1845
|
let integer = 0;
|
|
1847
1846
|
do {
|
|
1848
|
-
integer = charToInt[reader.next()];
|
|
1847
|
+
integer = charToInt$1[reader.next()];
|
|
1849
1848
|
value |= (integer & 31) << shift;
|
|
1850
1849
|
shift += 5;
|
|
1851
1850
|
} while (integer & 32);
|
|
@@ -1861,13 +1860,13 @@ function encodeInteger(builder, num, relative) {
|
|
|
1861
1860
|
let clamped = delta & 31;
|
|
1862
1861
|
delta >>>= 5;
|
|
1863
1862
|
if (delta > 0) clamped |= 32;
|
|
1864
|
-
builder.write(intToChar[clamped]);
|
|
1863
|
+
builder.write(intToChar$1[clamped]);
|
|
1865
1864
|
} while (delta > 0);
|
|
1866
1865
|
return num;
|
|
1867
1866
|
}
|
|
1868
|
-
function hasMoreVlq(reader, max) {
|
|
1867
|
+
function hasMoreVlq$1(reader, max) {
|
|
1869
1868
|
if (reader.pos >= max) return false;
|
|
1870
|
-
return reader.peek() !== comma;
|
|
1869
|
+
return reader.peek() !== comma$1;
|
|
1871
1870
|
}
|
|
1872
1871
|
var bufLength = 1024 * 16;
|
|
1873
1872
|
var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) {
|
|
@@ -1896,7 +1895,7 @@ var StringWriter = class {
|
|
|
1896
1895
|
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
1897
1896
|
}
|
|
1898
1897
|
};
|
|
1899
|
-
var StringReader = class {
|
|
1898
|
+
var StringReader$1 = class {
|
|
1900
1899
|
constructor(buffer) {
|
|
1901
1900
|
this.pos = 0;
|
|
1902
1901
|
this.buffer = buffer;
|
|
@@ -1913,9 +1912,9 @@ var StringReader = class {
|
|
|
1913
1912
|
return idx === -1 ? buffer.length : idx;
|
|
1914
1913
|
}
|
|
1915
1914
|
};
|
|
1916
|
-
function decode(mappings) {
|
|
1915
|
+
function decode$1(mappings) {
|
|
1917
1916
|
const { length } = mappings;
|
|
1918
|
-
const reader = new StringReader(mappings);
|
|
1917
|
+
const reader = new StringReader$1(mappings);
|
|
1919
1918
|
const decoded = [];
|
|
1920
1919
|
let genColumn = 0;
|
|
1921
1920
|
let sourcesIndex = 0;
|
|
@@ -1930,15 +1929,15 @@ function decode(mappings) {
|
|
|
1930
1929
|
genColumn = 0;
|
|
1931
1930
|
while (reader.pos < semi) {
|
|
1932
1931
|
let seg;
|
|
1933
|
-
genColumn = decodeInteger(reader, genColumn);
|
|
1932
|
+
genColumn = decodeInteger$1(reader, genColumn);
|
|
1934
1933
|
if (genColumn < lastCol) sorted = false;
|
|
1935
1934
|
lastCol = genColumn;
|
|
1936
|
-
if (hasMoreVlq(reader, semi)) {
|
|
1937
|
-
sourcesIndex = decodeInteger(reader, sourcesIndex);
|
|
1938
|
-
sourceLine = decodeInteger(reader, sourceLine);
|
|
1939
|
-
sourceColumn = decodeInteger(reader, sourceColumn);
|
|
1940
|
-
if (hasMoreVlq(reader, semi)) {
|
|
1941
|
-
namesIndex = decodeInteger(reader, namesIndex);
|
|
1935
|
+
if (hasMoreVlq$1(reader, semi)) {
|
|
1936
|
+
sourcesIndex = decodeInteger$1(reader, sourcesIndex);
|
|
1937
|
+
sourceLine = decodeInteger$1(reader, sourceLine);
|
|
1938
|
+
sourceColumn = decodeInteger$1(reader, sourceColumn);
|
|
1939
|
+
if (hasMoreVlq$1(reader, semi)) {
|
|
1940
|
+
namesIndex = decodeInteger$1(reader, namesIndex);
|
|
1942
1941
|
seg = [
|
|
1943
1942
|
genColumn,
|
|
1944
1943
|
sourcesIndex,
|
|
@@ -1956,16 +1955,16 @@ function decode(mappings) {
|
|
|
1956
1955
|
line.push(seg);
|
|
1957
1956
|
reader.pos++;
|
|
1958
1957
|
}
|
|
1959
|
-
if (!sorted) sort(line);
|
|
1958
|
+
if (!sorted) sort$1(line);
|
|
1960
1959
|
decoded.push(line);
|
|
1961
1960
|
reader.pos = semi + 1;
|
|
1962
1961
|
} while (reader.pos <= length);
|
|
1963
1962
|
return decoded;
|
|
1964
1963
|
}
|
|
1965
|
-
function sort(line) {
|
|
1966
|
-
line.sort(sortComparator$
|
|
1964
|
+
function sort$1(line) {
|
|
1965
|
+
line.sort(sortComparator$2);
|
|
1967
1966
|
}
|
|
1968
|
-
function sortComparator$
|
|
1967
|
+
function sortComparator$2(a, b) {
|
|
1969
1968
|
return a[0] - b[0];
|
|
1970
1969
|
}
|
|
1971
1970
|
function encode$1(decoded) {
|
|
@@ -1981,7 +1980,7 @@ function encode$1(decoded) {
|
|
|
1981
1980
|
let genColumn = 0;
|
|
1982
1981
|
for (let j = 0; j < line.length; j++) {
|
|
1983
1982
|
const segment = line[j];
|
|
1984
|
-
if (j > 0) writer.write(comma);
|
|
1983
|
+
if (j > 0) writer.write(comma$1);
|
|
1985
1984
|
genColumn = encodeInteger(writer, segment[0], genColumn);
|
|
1986
1985
|
if (segment.length === 1) continue;
|
|
1987
1986
|
sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
|
|
@@ -2122,7 +2121,7 @@ function normalizePath$3(url, type) {
|
|
|
2122
2121
|
/**
|
|
2123
2122
|
* Attempts to resolve `input` URL/path relative to `base`.
|
|
2124
2123
|
*/
|
|
2125
|
-
function resolve$
|
|
2124
|
+
function resolve$4(input, base) {
|
|
2126
2125
|
if (!input && !base) return "";
|
|
2127
2126
|
const url = parseUrl(input);
|
|
2128
2127
|
let inputType = url.type;
|
|
@@ -2167,13 +2166,13 @@ function stripFilename(path) {
|
|
|
2167
2166
|
function resolver(mapUrl, sourceRoot) {
|
|
2168
2167
|
const from = stripFilename(mapUrl);
|
|
2169
2168
|
const prefix = sourceRoot ? sourceRoot + "/" : "";
|
|
2170
|
-
return (source) => resolve$
|
|
2169
|
+
return (source) => resolve$4(prefix + (source || ""), from);
|
|
2171
2170
|
}
|
|
2172
|
-
var COLUMN$
|
|
2173
|
-
var SOURCES_INDEX$
|
|
2174
|
-
var SOURCE_LINE$
|
|
2175
|
-
var SOURCE_COLUMN$
|
|
2176
|
-
var NAMES_INDEX$
|
|
2171
|
+
var COLUMN$2 = 0;
|
|
2172
|
+
var SOURCES_INDEX$2 = 1;
|
|
2173
|
+
var SOURCE_LINE$2 = 2;
|
|
2174
|
+
var SOURCE_COLUMN$2 = 3;
|
|
2175
|
+
var NAMES_INDEX$2 = 4;
|
|
2177
2176
|
function maybeSort(mappings, owned) {
|
|
2178
2177
|
const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
|
|
2179
2178
|
if (unsortedIndex === mappings.length) return mappings;
|
|
@@ -2186,53 +2185,53 @@ function nextUnsortedSegmentLine(mappings, start) {
|
|
|
2186
2185
|
return mappings.length;
|
|
2187
2186
|
}
|
|
2188
2187
|
function isSorted(line) {
|
|
2189
|
-
for (let j = 1; j < line.length; j++) if (line[j][COLUMN$
|
|
2188
|
+
for (let j = 1; j < line.length; j++) if (line[j][COLUMN$2] < line[j - 1][COLUMN$2]) return false;
|
|
2190
2189
|
return true;
|
|
2191
2190
|
}
|
|
2192
2191
|
function sortSegments(line, owned) {
|
|
2193
2192
|
if (!owned) line = line.slice();
|
|
2194
|
-
return line.sort(sortComparator);
|
|
2193
|
+
return line.sort(sortComparator$1);
|
|
2195
2194
|
}
|
|
2196
|
-
function sortComparator(a, b) {
|
|
2197
|
-
return a[COLUMN$
|
|
2195
|
+
function sortComparator$1(a, b) {
|
|
2196
|
+
return a[COLUMN$2] - b[COLUMN$2];
|
|
2198
2197
|
}
|
|
2199
|
-
var found = false;
|
|
2200
|
-
function binarySearch(haystack, needle, low, high) {
|
|
2198
|
+
var found$1 = false;
|
|
2199
|
+
function binarySearch$1(haystack, needle, low, high) {
|
|
2201
2200
|
while (low <= high) {
|
|
2202
2201
|
const mid = low + (high - low >> 1);
|
|
2203
|
-
const cmp = haystack[mid][COLUMN$
|
|
2202
|
+
const cmp = haystack[mid][COLUMN$2] - needle;
|
|
2204
2203
|
if (cmp === 0) {
|
|
2205
|
-
found = true;
|
|
2204
|
+
found$1 = true;
|
|
2206
2205
|
return mid;
|
|
2207
2206
|
}
|
|
2208
2207
|
if (cmp < 0) low = mid + 1;
|
|
2209
2208
|
else high = mid - 1;
|
|
2210
2209
|
}
|
|
2211
|
-
found = false;
|
|
2210
|
+
found$1 = false;
|
|
2212
2211
|
return low - 1;
|
|
2213
2212
|
}
|
|
2214
|
-
function upperBound(haystack, needle, index) {
|
|
2215
|
-
for (let i = index + 1; i < haystack.length; index = i++) if (haystack[i][COLUMN$
|
|
2213
|
+
function upperBound$1(haystack, needle, index) {
|
|
2214
|
+
for (let i = index + 1; i < haystack.length; index = i++) if (haystack[i][COLUMN$2] !== needle) break;
|
|
2216
2215
|
return index;
|
|
2217
2216
|
}
|
|
2218
|
-
function lowerBound(haystack, needle, index) {
|
|
2219
|
-
for (let i = index - 1; i >= 0; index = i--) if (haystack[i][COLUMN$
|
|
2217
|
+
function lowerBound$1(haystack, needle, index) {
|
|
2218
|
+
for (let i = index - 1; i >= 0; index = i--) if (haystack[i][COLUMN$2] !== needle) break;
|
|
2220
2219
|
return index;
|
|
2221
2220
|
}
|
|
2222
|
-
function memoizedState() {
|
|
2221
|
+
function memoizedState$1() {
|
|
2223
2222
|
return {
|
|
2224
2223
|
lastKey: -1,
|
|
2225
2224
|
lastNeedle: -1,
|
|
2226
2225
|
lastIndex: -1
|
|
2227
2226
|
};
|
|
2228
2227
|
}
|
|
2229
|
-
function memoizedBinarySearch(haystack, needle, state, key) {
|
|
2228
|
+
function memoizedBinarySearch$1(haystack, needle, state, key) {
|
|
2230
2229
|
const { lastKey, lastNeedle, lastIndex } = state;
|
|
2231
2230
|
let low = 0;
|
|
2232
2231
|
let high = haystack.length - 1;
|
|
2233
2232
|
if (key === lastKey) {
|
|
2234
2233
|
if (needle === lastNeedle) {
|
|
2235
|
-
found = lastIndex !== -1 && haystack[lastIndex][COLUMN$
|
|
2234
|
+
found$1 = lastIndex !== -1 && haystack[lastIndex][COLUMN$2] === needle;
|
|
2236
2235
|
return lastIndex;
|
|
2237
2236
|
}
|
|
2238
2237
|
if (needle >= lastNeedle) low = lastIndex === -1 ? 0 : lastIndex;
|
|
@@ -2240,13 +2239,13 @@ function memoizedBinarySearch(haystack, needle, state, key) {
|
|
|
2240
2239
|
}
|
|
2241
2240
|
state.lastKey = key;
|
|
2242
2241
|
state.lastNeedle = needle;
|
|
2243
|
-
return state.lastIndex = binarySearch(haystack, needle, low, high);
|
|
2242
|
+
return state.lastIndex = binarySearch$1(haystack, needle, low, high);
|
|
2244
2243
|
}
|
|
2245
2244
|
function parse$3(map) {
|
|
2246
2245
|
return typeof map === "string" ? JSON.parse(map) : map;
|
|
2247
2246
|
}
|
|
2248
|
-
var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)";
|
|
2249
|
-
var COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)";
|
|
2247
|
+
var LINE_GTR_ZERO$1 = "`line` must be greater than 0 (lines start at line 1)";
|
|
2248
|
+
var COL_GTR_EQ_ZERO$1 = "`column` must be greater than or equal to 0 (columns start at column 0)";
|
|
2250
2249
|
var TraceMap = class {
|
|
2251
2250
|
constructor(map, mapUrl) {
|
|
2252
2251
|
const isString = typeof map === "string";
|
|
@@ -2271,41 +2270,41 @@ var TraceMap = class {
|
|
|
2271
2270
|
this._decoded = maybeSort(mappings, isString);
|
|
2272
2271
|
} else if (parsed.sections) throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);
|
|
2273
2272
|
else throw new Error(`invalid source map: ${JSON.stringify(parsed)}`);
|
|
2274
|
-
this._decodedMemo = memoizedState();
|
|
2273
|
+
this._decodedMemo = memoizedState$1();
|
|
2275
2274
|
this._bySources = void 0;
|
|
2276
2275
|
this._bySourceMemos = void 0;
|
|
2277
2276
|
}
|
|
2278
2277
|
};
|
|
2279
|
-
function cast$
|
|
2278
|
+
function cast$2(map) {
|
|
2280
2279
|
return map;
|
|
2281
2280
|
}
|
|
2282
|
-
function decodedMappings(map) {
|
|
2281
|
+
function decodedMappings$1(map) {
|
|
2283
2282
|
var _a;
|
|
2284
|
-
return (_a = cast$
|
|
2283
|
+
return (_a = cast$2(map))._decoded || (_a._decoded = decode$1(cast$2(map)._encoded));
|
|
2285
2284
|
}
|
|
2286
2285
|
function traceSegment(map, line, column) {
|
|
2287
|
-
const decoded = decodedMappings(map);
|
|
2286
|
+
const decoded = decodedMappings$1(map);
|
|
2288
2287
|
if (line >= decoded.length) return null;
|
|
2289
2288
|
const segments = decoded[line];
|
|
2290
|
-
const index = traceSegmentInternal(segments, cast$
|
|
2289
|
+
const index = traceSegmentInternal$1(segments, cast$2(map)._decodedMemo, line, column, 1);
|
|
2291
2290
|
return index === -1 ? null : segments[index];
|
|
2292
2291
|
}
|
|
2293
|
-
function originalPositionFor$
|
|
2292
|
+
function originalPositionFor$2(map, needle) {
|
|
2294
2293
|
let { line, column, bias } = needle;
|
|
2295
2294
|
line--;
|
|
2296
|
-
if (line < 0) throw new Error(LINE_GTR_ZERO);
|
|
2297
|
-
if (column < 0) throw new Error(COL_GTR_EQ_ZERO);
|
|
2298
|
-
const decoded = decodedMappings(map);
|
|
2299
|
-
if (line >= decoded.length) return OMapping(null, null, null, null);
|
|
2295
|
+
if (line < 0) throw new Error(LINE_GTR_ZERO$1);
|
|
2296
|
+
if (column < 0) throw new Error(COL_GTR_EQ_ZERO$1);
|
|
2297
|
+
const decoded = decodedMappings$1(map);
|
|
2298
|
+
if (line >= decoded.length) return OMapping$1(null, null, null, null);
|
|
2300
2299
|
const segments = decoded[line];
|
|
2301
|
-
const index = traceSegmentInternal(segments, cast$
|
|
2302
|
-
if (index === -1) return OMapping(null, null, null, null);
|
|
2300
|
+
const index = traceSegmentInternal$1(segments, cast$2(map)._decodedMemo, line, column, bias || 1);
|
|
2301
|
+
if (index === -1) return OMapping$1(null, null, null, null);
|
|
2303
2302
|
const segment = segments[index];
|
|
2304
|
-
if (segment.length === 1) return OMapping(null, null, null, null);
|
|
2303
|
+
if (segment.length === 1) return OMapping$1(null, null, null, null);
|
|
2305
2304
|
const { names, resolvedSources } = map;
|
|
2306
|
-
return OMapping(resolvedSources[segment[SOURCES_INDEX$
|
|
2305
|
+
return OMapping$1(resolvedSources[segment[SOURCES_INDEX$2]], segment[SOURCE_LINE$2] + 1, segment[SOURCE_COLUMN$2], segment.length === 5 ? names[segment[NAMES_INDEX$2]] : null);
|
|
2307
2306
|
}
|
|
2308
|
-
function OMapping(source, line, column, name) {
|
|
2307
|
+
function OMapping$1(source, line, column, name) {
|
|
2309
2308
|
return {
|
|
2310
2309
|
source,
|
|
2311
2310
|
line,
|
|
@@ -2313,9 +2312,9 @@ function OMapping(source, line, column, name) {
|
|
|
2313
2312
|
name
|
|
2314
2313
|
};
|
|
2315
2314
|
}
|
|
2316
|
-
function traceSegmentInternal(segments, memo, line, column, bias) {
|
|
2317
|
-
let index = memoizedBinarySearch(segments, column, memo, line);
|
|
2318
|
-
if (found) index = (bias === -1 ? upperBound : lowerBound)(segments, column, index);
|
|
2315
|
+
function traceSegmentInternal$1(segments, memo, line, column, bias) {
|
|
2316
|
+
let index = memoizedBinarySearch$1(segments, column, memo, line);
|
|
2317
|
+
if (found$1) index = (bias === -1 ? upperBound$1 : lowerBound$1)(segments, column, index);
|
|
2319
2318
|
else if (bias === -1) index++;
|
|
2320
2319
|
if (index === -1 || index === segments.length) return -1;
|
|
2321
2320
|
return index;
|
|
@@ -2328,22 +2327,22 @@ var SetArray = class {
|
|
|
2328
2327
|
this.array = [];
|
|
2329
2328
|
}
|
|
2330
2329
|
};
|
|
2331
|
-
function cast(set) {
|
|
2330
|
+
function cast$1(set) {
|
|
2332
2331
|
return set;
|
|
2333
2332
|
}
|
|
2334
2333
|
function get$2(setarr, key) {
|
|
2335
|
-
return cast(setarr)._indexes[key];
|
|
2334
|
+
return cast$1(setarr)._indexes[key];
|
|
2336
2335
|
}
|
|
2337
2336
|
function put(setarr, key) {
|
|
2338
2337
|
const index = get$2(setarr, key);
|
|
2339
2338
|
if (index !== void 0) return index;
|
|
2340
|
-
const { array, _indexes: indexes } = cast(setarr);
|
|
2339
|
+
const { array, _indexes: indexes } = cast$1(setarr);
|
|
2341
2340
|
return indexes[key] = array.push(key) - 1;
|
|
2342
2341
|
}
|
|
2343
2342
|
function remove(setarr, key) {
|
|
2344
2343
|
const index = get$2(setarr, key);
|
|
2345
2344
|
if (index === void 0) return;
|
|
2346
|
-
const { array, _indexes: indexes } = cast(setarr);
|
|
2345
|
+
const { array, _indexes: indexes } = cast$1(setarr);
|
|
2347
2346
|
for (let i = index + 1; i < array.length; i++) {
|
|
2348
2347
|
const k = array[i];
|
|
2349
2348
|
array[i - 1] = k;
|
|
@@ -2352,11 +2351,11 @@ function remove(setarr, key) {
|
|
|
2352
2351
|
indexes[key] = void 0;
|
|
2353
2352
|
array.pop();
|
|
2354
2353
|
}
|
|
2355
|
-
var COLUMN = 0;
|
|
2356
|
-
var SOURCES_INDEX = 1;
|
|
2357
|
-
var SOURCE_LINE = 2;
|
|
2358
|
-
var SOURCE_COLUMN = 3;
|
|
2359
|
-
var NAMES_INDEX = 4;
|
|
2354
|
+
var COLUMN$1 = 0;
|
|
2355
|
+
var SOURCES_INDEX$1 = 1;
|
|
2356
|
+
var SOURCE_LINE$1 = 2;
|
|
2357
|
+
var SOURCE_COLUMN$1 = 3;
|
|
2358
|
+
var NAMES_INDEX$1 = 4;
|
|
2360
2359
|
var NO_NAME = -1;
|
|
2361
2360
|
var GenMapping = class {
|
|
2362
2361
|
constructor({ file, sourceRoot } = {}) {
|
|
@@ -2439,7 +2438,7 @@ function getIndex(arr, index) {
|
|
|
2439
2438
|
}
|
|
2440
2439
|
function getColumnIndex(line, genColumn) {
|
|
2441
2440
|
let index = line.length;
|
|
2442
|
-
for (let i = index - 1; i >= 0; index = i--) if (genColumn >= line[i][COLUMN]) break;
|
|
2441
|
+
for (let i = index - 1; i >= 0; index = i--) if (genColumn >= line[i][COLUMN$1]) break;
|
|
2443
2442
|
return index;
|
|
2444
2443
|
}
|
|
2445
2444
|
function insert(array, index, value) {
|
|
@@ -2460,7 +2459,7 @@ function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIn
|
|
|
2460
2459
|
if (index === 0) return false;
|
|
2461
2460
|
const prev = line[index - 1];
|
|
2462
2461
|
if (prev.length === 1) return false;
|
|
2463
|
-
return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME);
|
|
2462
|
+
return sourcesIndex === prev[SOURCES_INDEX$1] && sourceLine === prev[SOURCE_LINE$1] && sourceColumn === prev[SOURCE_COLUMN$1] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX$1] : NO_NAME);
|
|
2464
2463
|
}
|
|
2465
2464
|
//#endregion
|
|
2466
2465
|
//#region ../../node_modules/.pnpm/@jridgewell+remapping@2.3.5/node_modules/@jridgewell/remapping/dist/remapping.mjs
|
|
@@ -2495,7 +2494,7 @@ function traceMappings(tree) {
|
|
|
2495
2494
|
const gen = new GenMapping({ file: tree.map.file });
|
|
2496
2495
|
const { sources: rootSources, map } = tree;
|
|
2497
2496
|
const rootNames = map.names;
|
|
2498
|
-
const rootMappings = decodedMappings(map);
|
|
2497
|
+
const rootMappings = decodedMappings$1(map);
|
|
2499
2498
|
for (let i = 0; i < rootMappings.length; i++) {
|
|
2500
2499
|
const segments = rootMappings[i];
|
|
2501
2500
|
for (let j = 0; j < segments.length; j++) {
|
|
@@ -2504,7 +2503,7 @@ function traceMappings(tree) {
|
|
|
2504
2503
|
let traced = SOURCELESS_MAPPING;
|
|
2505
2504
|
if (segment.length !== 1) {
|
|
2506
2505
|
const source2 = rootSources[segment[1]];
|
|
2507
|
-
traced = originalPositionFor(source2, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : "");
|
|
2506
|
+
traced = originalPositionFor$1(source2, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : "");
|
|
2508
2507
|
if (traced == null) continue;
|
|
2509
2508
|
}
|
|
2510
2509
|
const { column, line, name, content, source, ignore } = traced;
|
|
@@ -2515,12 +2514,12 @@ function traceMappings(tree) {
|
|
|
2515
2514
|
}
|
|
2516
2515
|
return gen;
|
|
2517
2516
|
}
|
|
2518
|
-
function originalPositionFor(source, line, column, name) {
|
|
2517
|
+
function originalPositionFor$1(source, line, column, name) {
|
|
2519
2518
|
if (!source.map) return SegmentObject(source.source, line, column, name, source.content, source.ignore);
|
|
2520
2519
|
const segment = traceSegment(source.map, line, column);
|
|
2521
2520
|
if (segment == null) return null;
|
|
2522
2521
|
if (segment.length === 1) return SOURCELESS_MAPPING;
|
|
2523
|
-
return originalPositionFor(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name);
|
|
2522
|
+
return originalPositionFor$1(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name);
|
|
2524
2523
|
}
|
|
2525
2524
|
function asArray(value) {
|
|
2526
2525
|
if (Array.isArray(value)) return value;
|
|
@@ -2711,7 +2710,7 @@ const require$1 = createRequire(import.meta.url);
|
|
|
2711
2710
|
function log$1(...args) {
|
|
2712
2711
|
process.stderr.write(`${formatWithOptions(inspectOpts, ...args)}\n`);
|
|
2713
2712
|
}
|
|
2714
|
-
const colors$
|
|
2713
|
+
const colors$36 = process.stderr.getColorDepth && process.stderr.getColorDepth() > 2 ? [
|
|
2715
2714
|
20,
|
|
2716
2715
|
21,
|
|
2717
2716
|
26,
|
|
@@ -2841,7 +2840,7 @@ function getDate() {
|
|
|
2841
2840
|
function init$1(debug) {
|
|
2842
2841
|
debug.inspectOpts = Object.assign({}, inspectOpts);
|
|
2843
2842
|
}
|
|
2844
|
-
const createDebug = setup(useColors(), colors$
|
|
2843
|
+
const createDebug = setup(useColors(), colors$36, log$1, load, save, formatArgs, init$1);
|
|
2845
2844
|
createDebug.inspectOpts = inspectOpts;
|
|
2846
2845
|
createDebug.formatters.o = function(v) {
|
|
2847
2846
|
this.inspectOpts.colors = this.useColors;
|
|
@@ -2855,7 +2854,7 @@ var node_default = createDebug;
|
|
|
2855
2854
|
createDebug.default = createDebug;
|
|
2856
2855
|
createDebug.debug = createDebug;
|
|
2857
2856
|
//#endregion
|
|
2858
|
-
//#region ../../node_modules/.pnpm/@rollup+pluginutils@5.3.0_rollup@4.
|
|
2857
|
+
//#region ../../node_modules/.pnpm/@rollup+pluginutils@5.3.0_rollup@4.59.0/node_modules/@rollup/pluginutils/dist/es/index.js
|
|
2859
2858
|
var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch$2(), 1);
|
|
2860
2859
|
function isArray(arg) {
|
|
2861
2860
|
return Array.isArray(arg);
|
|
@@ -4194,46 +4193,10 @@ function perEnvironmentPlugin(name, applyToEnvironment) {
|
|
|
4194
4193
|
};
|
|
4195
4194
|
}
|
|
4196
4195
|
//#endregion
|
|
4197
|
-
//#region ../../rolldown-vite/packages/vite/src/node/environment.ts
|
|
4198
|
-
/**
|
|
4199
|
-
* Creates a function that hides the complexities of a WeakMap with an initial value
|
|
4200
|
-
* to implement object metadata. Used by plugins to implement cross hooks per
|
|
4201
|
-
* environment metadata
|
|
4202
|
-
*
|
|
4203
|
-
* @experimental
|
|
4204
|
-
*/
|
|
4205
|
-
function perEnvironmentState(initial) {
|
|
4206
|
-
const stateMap = /* @__PURE__ */ new WeakMap();
|
|
4207
|
-
return function(context) {
|
|
4208
|
-
const { environment } = context;
|
|
4209
|
-
let state = stateMap.get(environment);
|
|
4210
|
-
if (!state) {
|
|
4211
|
-
state = initial(environment);
|
|
4212
|
-
stateMap.set(environment, state);
|
|
4213
|
-
}
|
|
4214
|
-
return state;
|
|
4215
|
-
};
|
|
4216
|
-
}
|
|
4217
|
-
//#endregion
|
|
4218
4196
|
//#region ../../rolldown-vite/packages/vite/src/node/plugins/reporter.ts
|
|
4219
|
-
const groups = [
|
|
4220
|
-
{
|
|
4221
|
-
name: "Assets",
|
|
4222
|
-
color: import_picocolors.default.green
|
|
4223
|
-
},
|
|
4224
|
-
{
|
|
4225
|
-
name: "CSS",
|
|
4226
|
-
color: import_picocolors.default.magenta
|
|
4227
|
-
},
|
|
4228
|
-
{
|
|
4229
|
-
name: "JS",
|
|
4230
|
-
color: import_picocolors.default.cyan
|
|
4231
|
-
}
|
|
4232
|
-
];
|
|
4233
|
-
const COMPRESSIBLE_ASSETS_RE = /\.(?:html|json|svg|txt|xml|xhtml|wasm)$/;
|
|
4234
4197
|
const VITE_VERSION_ONLY_LINE_RE = /^vite v\S+$/;
|
|
4235
4198
|
function buildReporterPlugin(config) {
|
|
4236
|
-
|
|
4199
|
+
return perEnvironmentPlugin("native:reporter", (env) => {
|
|
4237
4200
|
const tty = process.stdout.isTTY && !process.env.CI;
|
|
4238
4201
|
const shouldLogInfo = LogLevels[config.logLevel || "info"] >= LogLevels.info;
|
|
4239
4202
|
const assetsDir = path.join(env.config.build.assetsDir, "/");
|
|
@@ -4251,190 +4214,6 @@ function buildReporterPlugin(config) {
|
|
|
4251
4214
|
warnLargeChunks: env.config.build.minify && !env.config.build.lib && env.config.consumer === "client"
|
|
4252
4215
|
});
|
|
4253
4216
|
});
|
|
4254
|
-
const compress = promisify(gzip);
|
|
4255
|
-
const numberFormatter = new Intl.NumberFormat("en", {
|
|
4256
|
-
maximumFractionDigits: 2,
|
|
4257
|
-
minimumFractionDigits: 2
|
|
4258
|
-
});
|
|
4259
|
-
const displaySize = (bytes) => {
|
|
4260
|
-
return `${numberFormatter.format(bytes / 1e3)} kB`;
|
|
4261
|
-
};
|
|
4262
|
-
const tty = process.stdout.isTTY && !process.env.CI;
|
|
4263
|
-
const shouldLogInfo = LogLevels[config.logLevel || "info"] >= LogLevels.info;
|
|
4264
|
-
const modulesReporter = shouldLogInfo ? perEnvironmentState((environment) => {
|
|
4265
|
-
let hasTransformed = false;
|
|
4266
|
-
let transformedCount = 0;
|
|
4267
|
-
const logTransform = throttle((id) => {
|
|
4268
|
-
writeLine(`transforming (${transformedCount}) ${import_picocolors.default.dim(path.relative(config.root, id))}`);
|
|
4269
|
-
});
|
|
4270
|
-
return {
|
|
4271
|
-
reset() {
|
|
4272
|
-
transformedCount = 0;
|
|
4273
|
-
},
|
|
4274
|
-
register(id) {
|
|
4275
|
-
transformedCount++;
|
|
4276
|
-
if (!tty) {
|
|
4277
|
-
if (!hasTransformed) config.logger.info(`transforming...`);
|
|
4278
|
-
} else {
|
|
4279
|
-
if (id.includes(`?`)) return;
|
|
4280
|
-
logTransform(id);
|
|
4281
|
-
}
|
|
4282
|
-
hasTransformed = true;
|
|
4283
|
-
},
|
|
4284
|
-
log() {
|
|
4285
|
-
if (tty) clearLine$1();
|
|
4286
|
-
environment.logger.info(`${import_picocolors.default.green(`✓`)} ${transformedCount} modules transformed.`);
|
|
4287
|
-
}
|
|
4288
|
-
};
|
|
4289
|
-
}) : void 0;
|
|
4290
|
-
const chunksReporter = perEnvironmentState((environment) => {
|
|
4291
|
-
let hasRenderedChunk = false;
|
|
4292
|
-
let hasCompressChunk = false;
|
|
4293
|
-
let chunkCount = 0;
|
|
4294
|
-
let compressedCount = 0;
|
|
4295
|
-
async function getCompressedSize(code) {
|
|
4296
|
-
if (environment.config.consumer !== "client" || !environment.config.build.reportCompressedSize) return null;
|
|
4297
|
-
if (shouldLogInfo && !hasCompressChunk) {
|
|
4298
|
-
if (!tty) config.logger.info("computing gzip size...");
|
|
4299
|
-
else writeLine("computing gzip size (0)...");
|
|
4300
|
-
hasCompressChunk = true;
|
|
4301
|
-
}
|
|
4302
|
-
const compressed = await compress(typeof code === "string" ? code : Buffer.from(code));
|
|
4303
|
-
compressedCount++;
|
|
4304
|
-
if (shouldLogInfo && tty) writeLine(`computing gzip size (${compressedCount})...`);
|
|
4305
|
-
return compressed.length;
|
|
4306
|
-
}
|
|
4307
|
-
return {
|
|
4308
|
-
reset() {
|
|
4309
|
-
chunkCount = 0;
|
|
4310
|
-
compressedCount = 0;
|
|
4311
|
-
},
|
|
4312
|
-
register() {
|
|
4313
|
-
chunkCount++;
|
|
4314
|
-
if (shouldLogInfo) {
|
|
4315
|
-
if (!tty) {
|
|
4316
|
-
if (!hasRenderedChunk) environment.logger.info("rendering chunks...");
|
|
4317
|
-
} else writeLine(`rendering chunks (${chunkCount})...`);
|
|
4318
|
-
hasRenderedChunk = true;
|
|
4319
|
-
}
|
|
4320
|
-
},
|
|
4321
|
-
async log(output, outDir) {
|
|
4322
|
-
const chunkLimit = environment.config.build.chunkSizeWarningLimit;
|
|
4323
|
-
let hasLargeChunks = false;
|
|
4324
|
-
if (shouldLogInfo) {
|
|
4325
|
-
const entries = (await Promise.all(Object.values(output).map(async (chunk) => {
|
|
4326
|
-
if (chunk.type === "chunk") return {
|
|
4327
|
-
name: chunk.fileName,
|
|
4328
|
-
group: "JS",
|
|
4329
|
-
size: Buffer.byteLength(chunk.code),
|
|
4330
|
-
compressedSize: await getCompressedSize(chunk.code),
|
|
4331
|
-
mapSize: chunk.map ? Buffer.byteLength(chunk.map.toString()) : null
|
|
4332
|
-
};
|
|
4333
|
-
else {
|
|
4334
|
-
if (chunk.fileName.endsWith(".map")) return null;
|
|
4335
|
-
const isCSS = chunk.fileName.endsWith(".css");
|
|
4336
|
-
const isCompressible = isCSS || COMPRESSIBLE_ASSETS_RE.test(chunk.fileName);
|
|
4337
|
-
return {
|
|
4338
|
-
name: chunk.fileName,
|
|
4339
|
-
group: isCSS ? "CSS" : "Assets",
|
|
4340
|
-
size: Buffer.byteLength(chunk.source),
|
|
4341
|
-
mapSize: null,
|
|
4342
|
-
compressedSize: isCompressible ? await getCompressedSize(chunk.source) : null
|
|
4343
|
-
};
|
|
4344
|
-
}
|
|
4345
|
-
}))).filter(isDefined);
|
|
4346
|
-
if (tty) clearLine$1();
|
|
4347
|
-
let longest = 0;
|
|
4348
|
-
let biggestSize = 0;
|
|
4349
|
-
let biggestMap = 0;
|
|
4350
|
-
let biggestCompressSize = 0;
|
|
4351
|
-
for (const entry of entries) {
|
|
4352
|
-
if (entry.name.length > longest) longest = entry.name.length;
|
|
4353
|
-
if (entry.size > biggestSize) biggestSize = entry.size;
|
|
4354
|
-
if (entry.mapSize && entry.mapSize > biggestMap) biggestMap = entry.mapSize;
|
|
4355
|
-
if (entry.compressedSize && entry.compressedSize > biggestCompressSize) biggestCompressSize = entry.compressedSize;
|
|
4356
|
-
}
|
|
4357
|
-
const sizePad = displaySize(biggestSize).length;
|
|
4358
|
-
const mapPad = displaySize(biggestMap).length;
|
|
4359
|
-
const compressPad = displaySize(biggestCompressSize).length;
|
|
4360
|
-
const relativeOutDir = normalizePath$1(path.relative(config.root, path.resolve(config.root, outDir ?? environment.config.build.outDir)));
|
|
4361
|
-
const assetsDir = path.join(environment.config.build.assetsDir, "/");
|
|
4362
|
-
for (const group of groups) {
|
|
4363
|
-
const filtered = entries.filter((e) => e.group === group.name);
|
|
4364
|
-
if (!filtered.length) continue;
|
|
4365
|
-
for (const entry of filtered.sort((a, z) => a.size - z.size)) {
|
|
4366
|
-
const isLarge = group.name === "JS" && entry.size / 1e3 > chunkLimit;
|
|
4367
|
-
if (isLarge) hasLargeChunks = true;
|
|
4368
|
-
const sizeColor = isLarge ? import_picocolors.default.yellow : import_picocolors.default.dim;
|
|
4369
|
-
let log = import_picocolors.default.dim(withTrailingSlash(relativeOutDir));
|
|
4370
|
-
log += !config.build.lib && entry.name.startsWith(withTrailingSlash(assetsDir)) ? import_picocolors.default.dim(assetsDir) + group.color(entry.name.slice(assetsDir.length).padEnd(longest + 2 - assetsDir.length)) : group.color(entry.name.padEnd(longest + 2));
|
|
4371
|
-
log += import_picocolors.default.bold(sizeColor(displaySize(entry.size).padStart(sizePad)));
|
|
4372
|
-
if (entry.compressedSize) log += import_picocolors.default.dim(` │ gzip: ${displaySize(entry.compressedSize).padStart(compressPad)}`);
|
|
4373
|
-
if (entry.mapSize) log += import_picocolors.default.dim(` │ map: ${displaySize(entry.mapSize).padStart(mapPad)}`);
|
|
4374
|
-
config.logger.info(log);
|
|
4375
|
-
}
|
|
4376
|
-
}
|
|
4377
|
-
} else hasLargeChunks = Object.values(output).some((chunk) => {
|
|
4378
|
-
return chunk.type === "chunk" && chunk.code.length / 1e3 > chunkLimit;
|
|
4379
|
-
});
|
|
4380
|
-
if (hasLargeChunks && environment.config.build.minify && !config.build.lib && environment.config.consumer === "client") environment.logger.warn(import_picocolors.default.yellow(`\n(!) Some chunks are larger than ${chunkLimit} kB after minification. Consider:\n- Using dynamic import() to code-split the application\n- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks\n- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.`));
|
|
4381
|
-
}
|
|
4382
|
-
};
|
|
4383
|
-
});
|
|
4384
|
-
return {
|
|
4385
|
-
name: "vite:reporter",
|
|
4386
|
-
sharedDuringBuild: true,
|
|
4387
|
-
perEnvironmentStartEndDuringDev: true,
|
|
4388
|
-
...modulesReporter ? {
|
|
4389
|
-
transform(_, id) {
|
|
4390
|
-
modulesReporter(this).register(id);
|
|
4391
|
-
},
|
|
4392
|
-
buildStart() {
|
|
4393
|
-
modulesReporter(this).reset();
|
|
4394
|
-
},
|
|
4395
|
-
buildEnd() {
|
|
4396
|
-
modulesReporter(this).log();
|
|
4397
|
-
}
|
|
4398
|
-
} : {},
|
|
4399
|
-
renderStart() {
|
|
4400
|
-
chunksReporter(this).reset();
|
|
4401
|
-
},
|
|
4402
|
-
renderChunk(_, chunk, options) {
|
|
4403
|
-
if (options.codeSplitting !== false) for (const id of chunk.moduleIds) {
|
|
4404
|
-
const module = this.getModuleInfo(id);
|
|
4405
|
-
if (!module) continue;
|
|
4406
|
-
if (module.importers.length && module.dynamicImporters.length) {
|
|
4407
|
-
if (module.dynamicImporters.some((id) => !isInNodeModules(id) && chunk.moduleIds.includes(id))) this.warn(`\n(!) ${module.id} is dynamically imported by ${module.dynamicImporters.join(", ")} but also statically imported by ${module.importers.join(", ")}, dynamic import will not move module into another chunk.\n`);
|
|
4408
|
-
}
|
|
4409
|
-
}
|
|
4410
|
-
chunksReporter(this).register();
|
|
4411
|
-
},
|
|
4412
|
-
generateBundle() {
|
|
4413
|
-
if (shouldLogInfo && tty) clearLine$1();
|
|
4414
|
-
},
|
|
4415
|
-
async writeBundle({ dir }, output) {
|
|
4416
|
-
await chunksReporter(this).log(output, dir);
|
|
4417
|
-
}
|
|
4418
|
-
};
|
|
4419
|
-
}
|
|
4420
|
-
function writeLine(output) {
|
|
4421
|
-
clearLine$1();
|
|
4422
|
-
if (output.length < process.stdout.columns) process.stdout.write(output);
|
|
4423
|
-
else process.stdout.write(output.substring(0, process.stdout.columns - 1));
|
|
4424
|
-
}
|
|
4425
|
-
function clearLine$1() {
|
|
4426
|
-
process.stdout.clearLine(0);
|
|
4427
|
-
process.stdout.cursorTo(0);
|
|
4428
|
-
}
|
|
4429
|
-
function throttle(fn) {
|
|
4430
|
-
let timerHandle = null;
|
|
4431
|
-
return (...args) => {
|
|
4432
|
-
if (timerHandle) return;
|
|
4433
|
-
fn(...args);
|
|
4434
|
-
timerHandle = setTimeout(() => {
|
|
4435
|
-
timerHandle = null;
|
|
4436
|
-
}, 100);
|
|
4437
|
-
};
|
|
4438
4217
|
}
|
|
4439
4218
|
//#endregion
|
|
4440
4219
|
//#region ../../rolldown-vite/packages/vite/src/node/plugins/esbuild.ts
|
|
@@ -6405,7 +6184,7 @@ function shouldSkipWarning(warning) {
|
|
|
6405
6184
|
return false;
|
|
6406
6185
|
}
|
|
6407
6186
|
function oxcPlugin(config) {
|
|
6408
|
-
if (config.isBundled
|
|
6187
|
+
if (config.isBundled) return perEnvironmentPlugin("native:transform", (environment) => {
|
|
6409
6188
|
const { jsxInject, include = /\.(m?ts|[jt]sx)$/, exclude = /\.js$/, jsxRefreshInclude, jsxRefreshExclude, ..._transformOptions } = config.oxc;
|
|
6410
6189
|
const transformOptions = _transformOptions;
|
|
6411
6190
|
transformOptions.sourcemap = environment.config.mode !== "build" || !!environment.config.build.sourcemap;
|
|
@@ -7439,7 +7218,7 @@ var MagicString = class MagicString {
|
|
|
7439
7218
|
}
|
|
7440
7219
|
};
|
|
7441
7220
|
//#endregion
|
|
7442
|
-
//#region ../../node_modules/.pnpm/@rollup+plugin-alias@6.0.0_rollup@4.
|
|
7221
|
+
//#region ../../node_modules/.pnpm/@rollup+plugin-alias@6.0.0_rollup@4.59.0/node_modules/@rollup/plugin-alias/dist/index.js
|
|
7443
7222
|
function matches$1(pattern, importee) {
|
|
7444
7223
|
if (pattern instanceof RegExp) return pattern.test(importee);
|
|
7445
7224
|
if (importee.length < pattern.length) return false;
|
|
@@ -15288,6 +15067,111 @@ var require_launch_editor_middleware = /* @__PURE__ */ __commonJSMin(((exports,
|
|
|
15288
15067
|
};
|
|
15289
15068
|
}));
|
|
15290
15069
|
//#endregion
|
|
15070
|
+
//#region ../../node_modules/.pnpm/@vercel+detect-agent@1.1.0/node_modules/@vercel/detect-agent/dist/index.js
|
|
15071
|
+
var require_dist = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
15072
|
+
var __defProp = Object.defineProperty;
|
|
15073
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
15074
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
15075
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
15076
|
+
var __export = (target, all) => {
|
|
15077
|
+
for (var name in all) __defProp(target, name, {
|
|
15078
|
+
get: all[name],
|
|
15079
|
+
enumerable: true
|
|
15080
|
+
});
|
|
15081
|
+
};
|
|
15082
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15083
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15084
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15085
|
+
get: () => from[key],
|
|
15086
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15087
|
+
});
|
|
15088
|
+
}
|
|
15089
|
+
return to;
|
|
15090
|
+
};
|
|
15091
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15092
|
+
var src_exports = {};
|
|
15093
|
+
__export(src_exports, {
|
|
15094
|
+
KNOWN_AGENTS: () => KNOWN_AGENTS,
|
|
15095
|
+
determineAgent: () => determineAgent
|
|
15096
|
+
});
|
|
15097
|
+
module.exports = __toCommonJS(src_exports);
|
|
15098
|
+
var import_promises = __require$1("node:fs/promises");
|
|
15099
|
+
var import_node_fs = __require$1("node:fs");
|
|
15100
|
+
const DEVIN_LOCAL_PATH = "/opt/.devin";
|
|
15101
|
+
const CURSOR = "cursor";
|
|
15102
|
+
const CURSOR_CLI = "cursor-cli";
|
|
15103
|
+
const CLAUDE = "claude";
|
|
15104
|
+
const DEVIN = "devin";
|
|
15105
|
+
const REPLIT = "replit";
|
|
15106
|
+
const GEMINI = "gemini";
|
|
15107
|
+
const CODEX = "codex";
|
|
15108
|
+
const AUGMENT_CLI = "augment-cli";
|
|
15109
|
+
const OPENCODE = "opencode";
|
|
15110
|
+
const KNOWN_AGENTS = {
|
|
15111
|
+
CURSOR,
|
|
15112
|
+
CURSOR_CLI,
|
|
15113
|
+
CLAUDE,
|
|
15114
|
+
DEVIN,
|
|
15115
|
+
REPLIT,
|
|
15116
|
+
GEMINI,
|
|
15117
|
+
CODEX,
|
|
15118
|
+
AUGMENT_CLI,
|
|
15119
|
+
OPENCODE
|
|
15120
|
+
};
|
|
15121
|
+
async function determineAgent() {
|
|
15122
|
+
if (process.env.AI_AGENT) {
|
|
15123
|
+
const name = process.env.AI_AGENT.trim();
|
|
15124
|
+
if (name) return {
|
|
15125
|
+
isAgent: true,
|
|
15126
|
+
agent: { name }
|
|
15127
|
+
};
|
|
15128
|
+
}
|
|
15129
|
+
if (process.env.CURSOR_TRACE_ID) return {
|
|
15130
|
+
isAgent: true,
|
|
15131
|
+
agent: { name: CURSOR }
|
|
15132
|
+
};
|
|
15133
|
+
if (process.env.CURSOR_AGENT) return {
|
|
15134
|
+
isAgent: true,
|
|
15135
|
+
agent: { name: CURSOR_CLI }
|
|
15136
|
+
};
|
|
15137
|
+
if (process.env.GEMINI_CLI) return {
|
|
15138
|
+
isAgent: true,
|
|
15139
|
+
agent: { name: GEMINI }
|
|
15140
|
+
};
|
|
15141
|
+
if (process.env.CODEX_SANDBOX) return {
|
|
15142
|
+
isAgent: true,
|
|
15143
|
+
agent: { name: CODEX }
|
|
15144
|
+
};
|
|
15145
|
+
if (process.env.AUGMENT_AGENT) return {
|
|
15146
|
+
isAgent: true,
|
|
15147
|
+
agent: { name: AUGMENT_CLI }
|
|
15148
|
+
};
|
|
15149
|
+
if (process.env.OPENCODE_CLIENT) return {
|
|
15150
|
+
isAgent: true,
|
|
15151
|
+
agent: { name: OPENCODE }
|
|
15152
|
+
};
|
|
15153
|
+
if (process.env.CLAUDECODE || process.env.CLAUDE_CODE) return {
|
|
15154
|
+
isAgent: true,
|
|
15155
|
+
agent: { name: CLAUDE }
|
|
15156
|
+
};
|
|
15157
|
+
if (process.env.REPL_ID) return {
|
|
15158
|
+
isAgent: true,
|
|
15159
|
+
agent: { name: REPLIT }
|
|
15160
|
+
};
|
|
15161
|
+
try {
|
|
15162
|
+
await (0, import_promises.access)(DEVIN_LOCAL_PATH, import_node_fs.constants.F_OK);
|
|
15163
|
+
return {
|
|
15164
|
+
isAgent: true,
|
|
15165
|
+
agent: { name: DEVIN }
|
|
15166
|
+
};
|
|
15167
|
+
} catch (error) {}
|
|
15168
|
+
return {
|
|
15169
|
+
isAgent: false,
|
|
15170
|
+
agent: void 0
|
|
15171
|
+
};
|
|
15172
|
+
}
|
|
15173
|
+
}));
|
|
15174
|
+
//#endregion
|
|
15291
15175
|
//#region ../../rolldown-vite/packages/vite/src/node/http.ts
|
|
15292
15176
|
async function resolveHttpServer(app, httpsOptions) {
|
|
15293
15177
|
if (!httpsOptions) {
|
|
@@ -15412,7 +15296,7 @@ function ssrRewriteStacktrace(stack, moduleGraph) {
|
|
|
15412
15296
|
alreadyRewritten = true;
|
|
15413
15297
|
return input;
|
|
15414
15298
|
}
|
|
15415
|
-
const pos = originalPositionFor$
|
|
15299
|
+
const pos = originalPositionFor$2(traced, {
|
|
15416
15300
|
line,
|
|
15417
15301
|
column
|
|
15418
15302
|
});
|
|
@@ -15508,6 +15392,7 @@ function createServerModuleRunner(environment, options = {}) {
|
|
|
15508
15392
|
//#region ../../rolldown-vite/packages/vite/src/node/ssr/ssrModuleLoader.ts
|
|
15509
15393
|
async function ssrLoadModule(url, server, fixStacktrace) {
|
|
15510
15394
|
const environment = server.environments.ssr;
|
|
15395
|
+
if (!isRunnableDevEnvironment(environment)) throw new Error(`ssrLoadModule requires the 'ssr' environment to be a runnable environment.`);
|
|
15511
15396
|
server._ssrCompatModuleRunner ||= new SSRCompatModuleRunner(environment);
|
|
15512
15397
|
url = unwrapId(url);
|
|
15513
15398
|
return instantiateModule(url, server._ssrCompatModuleRunner, environment, fixStacktrace);
|
|
@@ -17146,9 +17031,12 @@ function resolveChokidarOptions(options, resolvedOutDirs, emptyOutDir, cacheDir)
|
|
|
17146
17031
|
...otherOptions
|
|
17147
17032
|
};
|
|
17148
17033
|
}
|
|
17149
|
-
function
|
|
17034
|
+
function convertToWatcherOptions(options) {
|
|
17150
17035
|
if (!options) return;
|
|
17151
|
-
return {
|
|
17036
|
+
return {
|
|
17037
|
+
usePolling: options.usePolling,
|
|
17038
|
+
pollInterval: options.interval
|
|
17039
|
+
};
|
|
17152
17040
|
}
|
|
17153
17041
|
var NoopWatcher = class extends EventEmitter {
|
|
17154
17042
|
constructor(options) {
|
|
@@ -23372,6 +23260,27 @@ var require_etag = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
23372
23260
|
}
|
|
23373
23261
|
}));
|
|
23374
23262
|
//#endregion
|
|
23263
|
+
//#region ../../rolldown-vite/packages/vite/src/node/environment.ts
|
|
23264
|
+
/**
|
|
23265
|
+
* Creates a function that hides the complexities of a WeakMap with an initial value
|
|
23266
|
+
* to implement object metadata. Used by plugins to implement cross hooks per
|
|
23267
|
+
* environment metadata
|
|
23268
|
+
*
|
|
23269
|
+
* @experimental
|
|
23270
|
+
*/
|
|
23271
|
+
function perEnvironmentState(initial) {
|
|
23272
|
+
const stateMap = /* @__PURE__ */ new WeakMap();
|
|
23273
|
+
return function(context) {
|
|
23274
|
+
const { environment } = context;
|
|
23275
|
+
let state = stateMap.get(environment);
|
|
23276
|
+
if (!state) {
|
|
23277
|
+
state = initial(environment);
|
|
23278
|
+
stateMap.set(environment, state);
|
|
23279
|
+
}
|
|
23280
|
+
return state;
|
|
23281
|
+
};
|
|
23282
|
+
}
|
|
23283
|
+
//#endregion
|
|
23375
23284
|
//#region ../../node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.mjs
|
|
23376
23285
|
var import_js_tokens = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
23377
23286
|
var HashbangComment, Identifier, JSXIdentifier, JSXPunctuator, JSXString, JSXText, KeywordsWithExpressionAfter, KeywordsWithNoLineTerminatorAfter, LineTerminatorSequence, MultiLineComment, Newline, NumericLiteral, Punctuator, RegularExpressionLiteral = /\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]?|[^\/[\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/uy, SingleLineComment, StringLiteral, Template, TokensNotPrecedingObjectLiteral, TokensPrecedingExpression, WhiteSpace;
|
|
@@ -25052,7 +24961,7 @@ var require_plugins = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
25052
24961
|
//#endregion
|
|
25053
24962
|
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_yaml@2.8.2/node_modules/postcss-load-config/src/index.js
|
|
25054
24963
|
var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
25055
|
-
const { resolve: resolve$
|
|
24964
|
+
const { resolve: resolve$3 } = __require$1("node:path");
|
|
25056
24965
|
const config = require_src$1();
|
|
25057
24966
|
const loadOptions = require_options();
|
|
25058
24967
|
const loadPlugins = require_plugins();
|
|
@@ -25171,7 +25080,7 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
25171
25080
|
/**
|
|
25172
25081
|
* @type {String} `process.cwd()`
|
|
25173
25082
|
*/
|
|
25174
|
-
path = path ? resolve$
|
|
25083
|
+
path = path ? resolve$3(path) : process.cwd();
|
|
25175
25084
|
return config.lilconfig("postcss", withLoaders(options)).search(path).then((result) => {
|
|
25176
25085
|
if (!result) throw new Error(`No PostCSS Config found in: ${path}`);
|
|
25177
25086
|
return processResult(ctx, result);
|
|
@@ -25400,8 +25309,8 @@ function applySourcemapIgnoreList(map, sourcemapPath, sourcemapIgnoreList, logge
|
|
|
25400
25309
|
}
|
|
25401
25310
|
}
|
|
25402
25311
|
}
|
|
25403
|
-
|
|
25404
|
-
const map = (import_convert_source_map.fromSource(code) ||
|
|
25312
|
+
function extractSourcemapFromFile(code, filePath) {
|
|
25313
|
+
const map = (import_convert_source_map.fromSource(code) || import_convert_source_map.fromMapFileSource(code, createConvertSourceMapReadMap(filePath)))?.toObject();
|
|
25405
25314
|
if (map) return {
|
|
25406
25315
|
code: code.replace(import_convert_source_map.default.mapFileCommentRegex, blankReplacer),
|
|
25407
25316
|
map
|
|
@@ -25409,7 +25318,7 @@ async function extractSourcemapFromFile(code, filePath) {
|
|
|
25409
25318
|
}
|
|
25410
25319
|
function createConvertSourceMapReadMap(originalFileName) {
|
|
25411
25320
|
return (filename) => {
|
|
25412
|
-
return
|
|
25321
|
+
return fs.readFileSync(path.resolve(path.dirname(originalFileName), filename), "utf-8");
|
|
25413
25322
|
};
|
|
25414
25323
|
}
|
|
25415
25324
|
//#endregion
|
|
@@ -25590,7 +25499,7 @@ function searchForWorkspaceRoot(current, root = searchForPackageRoot(current)) {
|
|
|
25590
25499
|
//#endregion
|
|
25591
25500
|
//#region ../../rolldown-vite/packages/vite/src/node/plugins/manifest.ts
|
|
25592
25501
|
const endsWithJSRE = /\.[cm]?js$/;
|
|
25593
|
-
function manifestPlugin(
|
|
25502
|
+
function manifestPlugin() {
|
|
25594
25503
|
const getState = perEnvironmentState(() => {
|
|
25595
25504
|
return {
|
|
25596
25505
|
manifest: {},
|
|
@@ -25601,7 +25510,7 @@ function manifestPlugin(config) {
|
|
|
25601
25510
|
}
|
|
25602
25511
|
};
|
|
25603
25512
|
});
|
|
25604
|
-
|
|
25513
|
+
return perEnvironmentPlugin("native:manifest", (environment) => {
|
|
25605
25514
|
if (!environment.config.build.manifest) return false;
|
|
25606
25515
|
const root = environment.config.root;
|
|
25607
25516
|
const outPath = environment.config.build.manifest === true ? ".vite/manifest.json" : environment.config.build.manifest;
|
|
@@ -25670,95 +25579,6 @@ function manifestPlugin(config) {
|
|
|
25670
25579
|
}
|
|
25671
25580
|
];
|
|
25672
25581
|
});
|
|
25673
|
-
return {
|
|
25674
|
-
name: "vite:manifest",
|
|
25675
|
-
perEnvironmentStartEndDuringDev: true,
|
|
25676
|
-
applyToEnvironment(environment) {
|
|
25677
|
-
return !!environment.config.build.manifest;
|
|
25678
|
-
},
|
|
25679
|
-
generateBundle(opts, bundle) {
|
|
25680
|
-
const state = getState(this);
|
|
25681
|
-
const { manifest } = state;
|
|
25682
|
-
const { root } = this.environment.config;
|
|
25683
|
-
const buildOptions = this.environment.config.build;
|
|
25684
|
-
const isLegacy = this.environment.config.isOutputOptionsForLegacyChunks?.(opts) ?? false;
|
|
25685
|
-
function getChunkName(chunk) {
|
|
25686
|
-
return getChunkOriginalFileName(chunk, root, isLegacy) ?? `_${path.basename(chunk.fileName)}`;
|
|
25687
|
-
}
|
|
25688
|
-
function getInternalImports(imports) {
|
|
25689
|
-
const filteredImports = [];
|
|
25690
|
-
for (const file of imports) {
|
|
25691
|
-
if (bundle[file] === void 0) continue;
|
|
25692
|
-
filteredImports.push(getChunkName(bundle[file]));
|
|
25693
|
-
}
|
|
25694
|
-
return filteredImports;
|
|
25695
|
-
}
|
|
25696
|
-
function createChunk(chunk) {
|
|
25697
|
-
const manifestChunk = {
|
|
25698
|
-
file: chunk.fileName,
|
|
25699
|
-
name: chunk.name
|
|
25700
|
-
};
|
|
25701
|
-
if (chunk.facadeModuleId) manifestChunk.src = getChunkName(chunk);
|
|
25702
|
-
if (chunk.isEntry) manifestChunk.isEntry = true;
|
|
25703
|
-
if (chunk.isDynamicEntry) manifestChunk.isDynamicEntry = true;
|
|
25704
|
-
if (chunk.imports.length) {
|
|
25705
|
-
const internalImports = getInternalImports(chunk.imports);
|
|
25706
|
-
if (internalImports.length > 0) manifestChunk.imports = internalImports;
|
|
25707
|
-
}
|
|
25708
|
-
if (chunk.dynamicImports.length) {
|
|
25709
|
-
const internalImports = getInternalImports(chunk.dynamicImports);
|
|
25710
|
-
if (internalImports.length > 0) manifestChunk.dynamicImports = internalImports;
|
|
25711
|
-
}
|
|
25712
|
-
if (chunk.viteMetadata?.importedCss.size) manifestChunk.css = [...chunk.viteMetadata.importedCss];
|
|
25713
|
-
if (chunk.viteMetadata?.importedAssets.size) manifestChunk.assets = [...chunk.viteMetadata.importedAssets];
|
|
25714
|
-
return manifestChunk;
|
|
25715
|
-
}
|
|
25716
|
-
function createAsset(asset, src, name) {
|
|
25717
|
-
const manifestChunk = {
|
|
25718
|
-
file: asset.fileName,
|
|
25719
|
-
src
|
|
25720
|
-
};
|
|
25721
|
-
if (name) {
|
|
25722
|
-
manifestChunk.isEntry = true;
|
|
25723
|
-
manifestChunk.name = name;
|
|
25724
|
-
manifestChunk.names = asset.names;
|
|
25725
|
-
if (asset.viteMetadata?.importedCss.size) manifestChunk.css = [...asset.viteMetadata.importedCss];
|
|
25726
|
-
if (asset.viteMetadata?.importedAssets.size) manifestChunk.assets = [...asset.viteMetadata.importedAssets];
|
|
25727
|
-
}
|
|
25728
|
-
return manifestChunk;
|
|
25729
|
-
}
|
|
25730
|
-
const entryCssReferenceIds = cssEntriesMap.get(this.environment);
|
|
25731
|
-
const entryCssAssetFileNames = /* @__PURE__ */ new Map();
|
|
25732
|
-
for (const [name, id] of entryCssReferenceIds) try {
|
|
25733
|
-
const fileName = this.getFileName(id);
|
|
25734
|
-
entryCssAssetFileNames.set(fileName, name);
|
|
25735
|
-
} catch {}
|
|
25736
|
-
for (const file in bundle) {
|
|
25737
|
-
const chunk = bundle[file];
|
|
25738
|
-
if (chunk.type === "chunk") manifest[getChunkName(chunk)] = createChunk(chunk);
|
|
25739
|
-
else if (chunk.type === "asset" && chunk.names.length > 0) {
|
|
25740
|
-
const src = chunk.originalFileNames.length > 0 ? chunk.originalFileNames[0] : `_${path.basename(chunk.fileName)}`;
|
|
25741
|
-
const asset = createAsset(chunk, src, entryCssAssetFileNames.get(chunk.fileName));
|
|
25742
|
-
const file = manifest[src]?.file;
|
|
25743
|
-
if (!(file && endsWithJSRE.test(file))) manifest[src] = asset;
|
|
25744
|
-
for (const originalFileName of chunk.originalFileNames.slice(1)) {
|
|
25745
|
-
const file = manifest[originalFileName]?.file;
|
|
25746
|
-
if (!(file && endsWithJSRE.test(file))) manifest[originalFileName] = asset;
|
|
25747
|
-
}
|
|
25748
|
-
}
|
|
25749
|
-
}
|
|
25750
|
-
state.outputCount++;
|
|
25751
|
-
const output = buildOptions.rollupOptions.output;
|
|
25752
|
-
if (state.outputCount >= (Array.isArray(output) ? output.length : 1)) {
|
|
25753
|
-
this.emitFile({
|
|
25754
|
-
fileName: typeof buildOptions.manifest === "string" ? buildOptions.manifest : ".vite/manifest.json",
|
|
25755
|
-
type: "asset",
|
|
25756
|
-
source: JSON.stringify(sortObjectKeys(manifest), void 0, 2)
|
|
25757
|
-
});
|
|
25758
|
-
state.reset();
|
|
25759
|
-
}
|
|
25760
|
-
}
|
|
25761
|
-
};
|
|
25762
25582
|
}
|
|
25763
25583
|
function getChunkOriginalFileName(chunk, root, isLegacy) {
|
|
25764
25584
|
if (chunk.facadeModuleId) {
|
|
@@ -25872,7 +25692,7 @@ function cssPlugin(config) {
|
|
|
25872
25692
|
const urlResolver = async (url, importer) => {
|
|
25873
25693
|
const decodedUrl = decodeURI(url);
|
|
25874
25694
|
if (checkPublicFile(decodedUrl, config)) if (encodePublicUrlsInCSS(config)) return [publicFileToBuiltUrl(decodedUrl, config), void 0];
|
|
25875
|
-
else return [joinUrlSegments(config.base, decodedUrl), void 0];
|
|
25695
|
+
else return [joinUrlSegments(joinUrlSegments(config.server.origin ?? "", config.base), decodedUrl), void 0];
|
|
25876
25696
|
const [id, fragment] = decodedUrl.split("#");
|
|
25877
25697
|
let resolved = await resolveUrl(id, importer);
|
|
25878
25698
|
if (resolved) {
|
|
@@ -27422,6 +27242,14 @@ const esMap = {
|
|
|
27422
27242
|
"ios17.4",
|
|
27423
27243
|
"firefox145",
|
|
27424
27244
|
"opera105"
|
|
27245
|
+
],
|
|
27246
|
+
2025: [
|
|
27247
|
+
"chrome136",
|
|
27248
|
+
"edge136",
|
|
27249
|
+
"safari26.0",
|
|
27250
|
+
"ios26.0",
|
|
27251
|
+
"firefox138",
|
|
27252
|
+
"opera121"
|
|
27425
27253
|
]
|
|
27426
27254
|
};
|
|
27427
27255
|
const esRE = /es(\d{4})/;
|
|
@@ -28227,8 +28055,6 @@ function incrementIndent(indent = "") {
|
|
|
28227
28055
|
//#region ../../rolldown-vite/packages/vite/src/node/plugins/define.ts
|
|
28228
28056
|
const nonJsRe = /\.json(?:$|\?)/;
|
|
28229
28057
|
const isNonJsRequest = (request) => nonJsRe.test(request);
|
|
28230
|
-
const importMetaEnvMarker = "__vite_import_meta_env__";
|
|
28231
|
-
const importMetaEnvKeyReCache = /* @__PURE__ */ new Map();
|
|
28232
28058
|
const escapedDotRE = /(?<!\\)\\./g;
|
|
28233
28059
|
function definePlugin(config) {
|
|
28234
28060
|
const isBundled = config.isBundled;
|
|
@@ -28275,7 +28101,6 @@ function definePlugin(config) {
|
|
|
28275
28101
|
};
|
|
28276
28102
|
const ssr = environment.config.consumer === "server";
|
|
28277
28103
|
if ("import.meta.env.SSR" in define) define["import.meta.env.SSR"] = ssr + "";
|
|
28278
|
-
if ("import.meta.env" in define) define["import.meta.env"] = importMetaEnvMarker;
|
|
28279
28104
|
const importMetaEnvVal = serializeDefine({
|
|
28280
28105
|
...importMetaEnvKeys,
|
|
28281
28106
|
SSR: ssr + "",
|
|
@@ -28299,7 +28124,7 @@ function definePlugin(config) {
|
|
|
28299
28124
|
}
|
|
28300
28125
|
return pattern;
|
|
28301
28126
|
}
|
|
28302
|
-
if (isBundled
|
|
28127
|
+
if (isBundled) return {
|
|
28303
28128
|
name: "vite:define",
|
|
28304
28129
|
options(option) {
|
|
28305
28130
|
const [define, _pattern, importMetaEnvVal] = getPattern(this.environment);
|
|
@@ -28315,33 +28140,13 @@ function definePlugin(config) {
|
|
|
28315
28140
|
return {
|
|
28316
28141
|
name: "vite:define",
|
|
28317
28142
|
transform: { async handler(code, id) {
|
|
28318
|
-
if (this.environment.config.consumer === "client"
|
|
28143
|
+
if (this.environment.config.consumer === "client") return;
|
|
28319
28144
|
if (isHTMLRequest(id) || isCSSRequest(id) || isNonJsRequest(id) || config.assetsInclude(id)) return;
|
|
28320
|
-
|
|
28145
|
+
const [define, pattern] = getPattern(this.environment);
|
|
28321
28146
|
if (!pattern) return;
|
|
28322
28147
|
pattern.lastIndex = 0;
|
|
28323
28148
|
if (!pattern.test(code)) return;
|
|
28324
|
-
|
|
28325
|
-
let marker = importMetaEnvMarker;
|
|
28326
|
-
if (hasDefineImportMetaEnv && code.includes(marker)) {
|
|
28327
|
-
let i = 1;
|
|
28328
|
-
do
|
|
28329
|
-
marker = importMetaEnvMarker + i++;
|
|
28330
|
-
while (code.includes(marker));
|
|
28331
|
-
if (marker !== importMetaEnvMarker) define = {
|
|
28332
|
-
...define,
|
|
28333
|
-
"import.meta.env": marker
|
|
28334
|
-
};
|
|
28335
|
-
}
|
|
28336
|
-
const result = await replaceDefine(this.environment, code, id, define);
|
|
28337
|
-
if (hasDefineImportMetaEnv) {
|
|
28338
|
-
result.code = result.code.replaceAll(getImportMetaEnvKeyRe(marker), (m) => "undefined".padEnd(m.length));
|
|
28339
|
-
if (result.code.includes(marker)) {
|
|
28340
|
-
result.code = `const ${marker} = ${importMetaEnvVal};\n` + result.code;
|
|
28341
|
-
if (result.map) result.map.mappings = ";" + result.map.mappings;
|
|
28342
|
-
}
|
|
28343
|
-
}
|
|
28344
|
-
return result;
|
|
28149
|
+
return await replaceDefine(this.environment, code, id, define);
|
|
28345
28150
|
} }
|
|
28346
28151
|
};
|
|
28347
28152
|
}
|
|
@@ -28380,14 +28185,6 @@ function handleDefineValue(value) {
|
|
|
28380
28185
|
if (typeof value === "string") return value;
|
|
28381
28186
|
return JSON.stringify(value);
|
|
28382
28187
|
}
|
|
28383
|
-
function getImportMetaEnvKeyRe(marker) {
|
|
28384
|
-
let re = importMetaEnvKeyReCache.get(marker);
|
|
28385
|
-
if (!re) {
|
|
28386
|
-
re = new RegExp(`${marker}\\..+?\\b`, "g");
|
|
28387
|
-
importMetaEnvKeyReCache.set(marker, re);
|
|
28388
|
-
}
|
|
28389
|
-
return re;
|
|
28390
|
-
}
|
|
28391
28188
|
//#endregion
|
|
28392
28189
|
//#region ../../rolldown-vite/packages/vite/src/node/plugins/clientInjections.ts
|
|
28393
28190
|
const normalizedClientEntry$1 = normalizePath$1(CLIENT_ENTRY);
|
|
@@ -28461,8 +28258,9 @@ async function createClientConfigValueReplacer(config) {
|
|
|
28461
28258
|
const hmrEnableOverlayReplacement = escapeReplacement(overlay);
|
|
28462
28259
|
const hmrConfigNameReplacement = escapeReplacement(hmrConfigName);
|
|
28463
28260
|
const wsTokenReplacement = escapeReplacement(config.webSocketToken);
|
|
28261
|
+
const serverForwardConsoleReplacement = escapeReplacement(config.server.forwardConsole);
|
|
28464
28262
|
const bundleDevReplacement = escapeReplacement(config.experimental.bundledDev || false);
|
|
28465
|
-
return (code) => code.replace(`__MODE__`, modeReplacement).replace(/__BASE__/g, baseReplacement).replace(`__SERVER_HOST__`, serverHostReplacement).replace(`__HMR_PROTOCOL__`, hmrProtocolReplacement).replace(`__HMR_HOSTNAME__`, hmrHostnameReplacement).replace(`__HMR_PORT__`, hmrPortReplacement).replace(`__HMR_DIRECT_TARGET__`, hmrDirectTargetReplacement).replace(`__HMR_BASE__`, hmrBaseReplacement).replace(`__HMR_TIMEOUT__`, hmrTimeoutReplacement).replace(`__HMR_ENABLE_OVERLAY__`, hmrEnableOverlayReplacement).replace(`__HMR_CONFIG_NAME__`, hmrConfigNameReplacement).replace(`__WS_TOKEN__`, wsTokenReplacement).replaceAll(`__BUNDLED_DEV__`, bundleDevReplacement);
|
|
28263
|
+
return (code) => code.replace(`__MODE__`, modeReplacement).replace(/__BASE__/g, baseReplacement).replace(`__SERVER_HOST__`, serverHostReplacement).replace(`__HMR_PROTOCOL__`, hmrProtocolReplacement).replace(`__HMR_HOSTNAME__`, hmrHostnameReplacement).replace(`__HMR_PORT__`, hmrPortReplacement).replace(`__HMR_DIRECT_TARGET__`, hmrDirectTargetReplacement).replace(`__HMR_BASE__`, hmrBaseReplacement).replace(`__HMR_TIMEOUT__`, hmrTimeoutReplacement).replace(`__HMR_ENABLE_OVERLAY__`, hmrEnableOverlayReplacement).replace(`__HMR_CONFIG_NAME__`, hmrConfigNameReplacement).replace(`__WS_TOKEN__`, wsTokenReplacement).replace(`__SERVER_FORWARD_CONSOLE__`, serverForwardConsoleReplacement).replaceAll(`__BUNDLED_DEV__`, bundleDevReplacement);
|
|
28466
28264
|
}
|
|
28467
28265
|
async function getHmrImplementation(config) {
|
|
28468
28266
|
const content = fs.readFileSync(normalizedClientEntry$1, "utf-8");
|
|
@@ -29667,7 +29465,7 @@ async function loadAndTransform(environment, id, url, options, timestamp, mod, r
|
|
|
29667
29465
|
if (code != null && environment.pluginContainer.watcher) ensureWatchedFile(environment.pluginContainer.watcher, file, config.root);
|
|
29668
29466
|
}
|
|
29669
29467
|
if (code) try {
|
|
29670
|
-
const extracted =
|
|
29468
|
+
const extracted = extractSourcemapFromFile(code, file);
|
|
29671
29469
|
if (extracted) {
|
|
29672
29470
|
code = extracted.code;
|
|
29673
29471
|
map = extracted.map;
|
|
@@ -31414,7 +31212,28 @@ var import_connect = /* @__PURE__ */ __toESM(require_connect(), 1);
|
|
|
31414
31212
|
var import_lib = /* @__PURE__ */ __toESM(require_lib$1(), 1);
|
|
31415
31213
|
var import_chokidar = /* @__PURE__ */ __toESM(require_chokidar(), 1);
|
|
31416
31214
|
var import_launch_editor_middleware = /* @__PURE__ */ __toESM(require_launch_editor_middleware(), 1);
|
|
31215
|
+
var import_dist = require_dist();
|
|
31417
31216
|
const usedConfigs = /* @__PURE__ */ new WeakSet();
|
|
31217
|
+
async function resolveForwardConsoleOptions(value) {
|
|
31218
|
+
value ??= (await (0, import_dist.determineAgent)()).isAgent;
|
|
31219
|
+
if (value === false) return {
|
|
31220
|
+
enabled: false,
|
|
31221
|
+
unhandledErrors: false,
|
|
31222
|
+
logLevels: []
|
|
31223
|
+
};
|
|
31224
|
+
if (value === true) return {
|
|
31225
|
+
enabled: true,
|
|
31226
|
+
unhandledErrors: true,
|
|
31227
|
+
logLevels: ["error", "warn"]
|
|
31228
|
+
};
|
|
31229
|
+
const unhandledErrors = value.unhandledErrors ?? true;
|
|
31230
|
+
const logLevels = value.logLevels ?? [];
|
|
31231
|
+
return {
|
|
31232
|
+
enabled: unhandledErrors || logLevels.length > 0,
|
|
31233
|
+
unhandledErrors,
|
|
31234
|
+
logLevels
|
|
31235
|
+
};
|
|
31236
|
+
}
|
|
31418
31237
|
function createServer$2(inlineConfig = {}) {
|
|
31419
31238
|
return _createServer(inlineConfig, { listen: true });
|
|
31420
31239
|
}
|
|
@@ -31780,10 +31599,11 @@ const _serverConfigDefaults = Object.freeze({
|
|
|
31780
31599
|
},
|
|
31781
31600
|
preTransformRequests: true,
|
|
31782
31601
|
perEnvironmentStartEndDuringDev: false,
|
|
31783
|
-
perEnvironmentWatchChangeDuringDev: false
|
|
31602
|
+
perEnvironmentWatchChangeDuringDev: false,
|
|
31603
|
+
forwardConsole: void 0
|
|
31784
31604
|
});
|
|
31785
31605
|
const serverConfigDefaults = _serverConfigDefaults;
|
|
31786
|
-
function resolveServerOptions(root, raw, logger) {
|
|
31606
|
+
async function resolveServerOptions(root, raw, logger) {
|
|
31787
31607
|
const _server = mergeWithDefaults({
|
|
31788
31608
|
..._serverConfigDefaults,
|
|
31789
31609
|
host: void 0,
|
|
@@ -31795,7 +31615,8 @@ function resolveServerOptions(root, raw, logger) {
|
|
|
31795
31615
|
..._server.fs,
|
|
31796
31616
|
allow: raw?.fs?.allow ?? [searchForWorkspaceRoot(root)]
|
|
31797
31617
|
},
|
|
31798
|
-
sourcemapIgnoreList: _server.sourcemapIgnoreList === false ? () => false : _server.sourcemapIgnoreList
|
|
31618
|
+
sourcemapIgnoreList: _server.sourcemapIgnoreList === false ? () => false : _server.sourcemapIgnoreList,
|
|
31619
|
+
forwardConsole: await resolveForwardConsoleOptions(_server.forwardConsole)
|
|
31799
31620
|
};
|
|
31800
31621
|
let allowDirs = server.fs.allow;
|
|
31801
31622
|
if (process.versions.pnp) {
|
|
@@ -32619,7 +32440,7 @@ async function workerFileToUrl(config, id) {
|
|
|
32619
32440
|
return bundle;
|
|
32620
32441
|
}
|
|
32621
32442
|
function webWorkerPostPlugin(config) {
|
|
32622
|
-
if (config.isBundled
|
|
32443
|
+
if (config.isBundled) return perEnvironmentPlugin("native:web-worker-post-plugin", (environment) => {
|
|
32623
32444
|
if (environment.config.worker.format === "iife") return viteWebWorkerPostPlugin();
|
|
32624
32445
|
});
|
|
32625
32446
|
return {
|
|
@@ -33369,6 +33190,7 @@ export default ${wasmHelperCode}
|
|
|
33369
33190
|
`;
|
|
33370
33191
|
id = id.split("?")[0];
|
|
33371
33192
|
let url = await fileToUrl$1(this, id, ssr);
|
|
33193
|
+
assetUrlRE.lastIndex = 0;
|
|
33372
33194
|
if (ssr && assetUrlRE.test(url)) url = url.replace("__VITE_ASSET__", "__VITE_WASM_INIT__");
|
|
33373
33195
|
return `
|
|
33374
33196
|
import initWasm from "${wasmHelperId}"
|
|
@@ -33951,7 +33773,7 @@ function getQueryDelimiterIndex(rawUrl) {
|
|
|
33951
33773
|
return -1;
|
|
33952
33774
|
}
|
|
33953
33775
|
//#endregion
|
|
33954
|
-
//#region ../../node_modules/.pnpm/@rollup+plugin-dynamic-import-vars@2.1.4_rollup@4.
|
|
33776
|
+
//#region ../../node_modules/.pnpm/@rollup+plugin-dynamic-import-vars@2.1.4_rollup@4.59.0/node_modules/@rollup/plugin-dynamic-import-vars/dist/es/index.js
|
|
33955
33777
|
var VariableDynamicImportError = class extends Error {};
|
|
33956
33778
|
const example = "For example: import(`./foo/${bar}.js`).";
|
|
33957
33779
|
function sanitizeString(str) {
|
|
@@ -34070,7 +33892,7 @@ function dynamicImportVarsPlugin(config) {
|
|
|
34070
33892
|
tryIndex: false,
|
|
34071
33893
|
extensions: []
|
|
34072
33894
|
});
|
|
34073
|
-
if (config.isBundled
|
|
33895
|
+
if (config.isBundled) return perEnvironmentPlugin("native:dynamic-import-vars", (environment) => {
|
|
34074
33896
|
const { include, exclude } = environment.config.build.dynamicImportVarsOptions;
|
|
34075
33897
|
return viteDynamicImportVarsPlugin({
|
|
34076
33898
|
include,
|
|
@@ -34144,7 +33966,7 @@ function dynamicImportVarsPlugin(config) {
|
|
|
34144
33966
|
//#endregion
|
|
34145
33967
|
//#region ../../rolldown-vite/packages/vite/src/node/plugins/importMetaGlob.ts
|
|
34146
33968
|
function importGlobPlugin(config) {
|
|
34147
|
-
if (config.isBundled
|
|
33969
|
+
if (config.isBundled) return viteImportGlobPlugin({
|
|
34148
33970
|
root: config.root,
|
|
34149
33971
|
sourcemap: !!config.build.sourcemap,
|
|
34150
33972
|
restoreQueryExtension: config.experimental.importGlobRestoreExtension
|
|
@@ -34347,7 +34169,8 @@ async function transformGlobImport(code, id, root, resolveId, restoreQueryExtens
|
|
|
34347
34169
|
cwd: getCommonBase(globsResolved) ?? root,
|
|
34348
34170
|
dot: !!options.exhaustive,
|
|
34349
34171
|
expandDirectories: false,
|
|
34350
|
-
ignore: options.exhaustive ? [] : ["**/node_modules/**"]
|
|
34172
|
+
ignore: options.exhaustive ? [] : ["**/node_modules/**"],
|
|
34173
|
+
extglob: false
|
|
34351
34174
|
})).filter((file) => file !== id).sort();
|
|
34352
34175
|
const objectProps = [];
|
|
34353
34176
|
const staticImports = [];
|
|
@@ -34553,6 +34376,526 @@ function createFilterForTransform(idFilter, codeFilter, moduleTypeFilter, cwd) {
|
|
|
34553
34376
|
};
|
|
34554
34377
|
}
|
|
34555
34378
|
//#endregion
|
|
34379
|
+
//#region ../../node_modules/.pnpm/@vitest+utils@4.1.0-beta.5/node_modules/@vitest/utils/dist/helpers.js
|
|
34380
|
+
function notNullish(v) {
|
|
34381
|
+
return v != null;
|
|
34382
|
+
}
|
|
34383
|
+
function isPrimitive(value) {
|
|
34384
|
+
return value === null || typeof value !== "function" && typeof value !== "object";
|
|
34385
|
+
}
|
|
34386
|
+
//#endregion
|
|
34387
|
+
//#region ../../node_modules/.pnpm/@vitest+utils@4.1.0-beta.5/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js
|
|
34388
|
+
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
34389
|
+
function normalizeWindowsPath(input = "") {
|
|
34390
|
+
if (!input) return input;
|
|
34391
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
34392
|
+
}
|
|
34393
|
+
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
34394
|
+
function cwd() {
|
|
34395
|
+
if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
|
|
34396
|
+
return "/";
|
|
34397
|
+
}
|
|
34398
|
+
const resolve$2 = function(...arguments_) {
|
|
34399
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
34400
|
+
let resolvedPath = "";
|
|
34401
|
+
let resolvedAbsolute = false;
|
|
34402
|
+
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
34403
|
+
const path = index >= 0 ? arguments_[index] : cwd();
|
|
34404
|
+
if (!path || path.length === 0) continue;
|
|
34405
|
+
resolvedPath = `${path}/${resolvedPath}`;
|
|
34406
|
+
resolvedAbsolute = isAbsolute$2(path);
|
|
34407
|
+
}
|
|
34408
|
+
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
34409
|
+
if (resolvedAbsolute && !isAbsolute$2(resolvedPath)) return `/${resolvedPath}`;
|
|
34410
|
+
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
34411
|
+
};
|
|
34412
|
+
function normalizeString(path, allowAboveRoot) {
|
|
34413
|
+
let res = "";
|
|
34414
|
+
let lastSegmentLength = 0;
|
|
34415
|
+
let lastSlash = -1;
|
|
34416
|
+
let dots = 0;
|
|
34417
|
+
let char = null;
|
|
34418
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
34419
|
+
if (index < path.length) char = path[index];
|
|
34420
|
+
else if (char === "/") break;
|
|
34421
|
+
else char = "/";
|
|
34422
|
+
if (char === "/") {
|
|
34423
|
+
if (lastSlash === index - 1 || dots === 1);
|
|
34424
|
+
else if (dots === 2) {
|
|
34425
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
34426
|
+
if (res.length > 2) {
|
|
34427
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
34428
|
+
if (lastSlashIndex === -1) {
|
|
34429
|
+
res = "";
|
|
34430
|
+
lastSegmentLength = 0;
|
|
34431
|
+
} else {
|
|
34432
|
+
res = res.slice(0, lastSlashIndex);
|
|
34433
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
34434
|
+
}
|
|
34435
|
+
lastSlash = index;
|
|
34436
|
+
dots = 0;
|
|
34437
|
+
continue;
|
|
34438
|
+
} else if (res.length > 0) {
|
|
34439
|
+
res = "";
|
|
34440
|
+
lastSegmentLength = 0;
|
|
34441
|
+
lastSlash = index;
|
|
34442
|
+
dots = 0;
|
|
34443
|
+
continue;
|
|
34444
|
+
}
|
|
34445
|
+
}
|
|
34446
|
+
if (allowAboveRoot) {
|
|
34447
|
+
res += res.length > 0 ? "/.." : "..";
|
|
34448
|
+
lastSegmentLength = 2;
|
|
34449
|
+
}
|
|
34450
|
+
} else {
|
|
34451
|
+
if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
|
|
34452
|
+
else res = path.slice(lastSlash + 1, index);
|
|
34453
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
34454
|
+
}
|
|
34455
|
+
lastSlash = index;
|
|
34456
|
+
dots = 0;
|
|
34457
|
+
} else if (char === "." && dots !== -1) ++dots;
|
|
34458
|
+
else dots = -1;
|
|
34459
|
+
}
|
|
34460
|
+
return res;
|
|
34461
|
+
}
|
|
34462
|
+
const isAbsolute$2 = function(p) {
|
|
34463
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
34464
|
+
};
|
|
34465
|
+
//#endregion
|
|
34466
|
+
//#region ../../node_modules/.pnpm/@vitest+utils@4.1.0-beta.5/node_modules/@vitest/utils/dist/source-map.js
|
|
34467
|
+
var comma = ",".charCodeAt(0);
|
|
34468
|
+
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
34469
|
+
var intToChar = new Uint8Array(64);
|
|
34470
|
+
var charToInt = new Uint8Array(128);
|
|
34471
|
+
for (let i = 0; i < chars.length; i++) {
|
|
34472
|
+
const c = chars.charCodeAt(i);
|
|
34473
|
+
intToChar[i] = c;
|
|
34474
|
+
charToInt[c] = i;
|
|
34475
|
+
}
|
|
34476
|
+
function decodeInteger(reader, relative) {
|
|
34477
|
+
let value = 0;
|
|
34478
|
+
let shift = 0;
|
|
34479
|
+
let integer = 0;
|
|
34480
|
+
do {
|
|
34481
|
+
integer = charToInt[reader.next()];
|
|
34482
|
+
value |= (integer & 31) << shift;
|
|
34483
|
+
shift += 5;
|
|
34484
|
+
} while (integer & 32);
|
|
34485
|
+
const shouldNegate = value & 1;
|
|
34486
|
+
value >>>= 1;
|
|
34487
|
+
if (shouldNegate) value = -2147483648 | -value;
|
|
34488
|
+
return relative + value;
|
|
34489
|
+
}
|
|
34490
|
+
function hasMoreVlq(reader, max) {
|
|
34491
|
+
if (reader.pos >= max) return false;
|
|
34492
|
+
return reader.peek() !== comma;
|
|
34493
|
+
}
|
|
34494
|
+
var StringReader = class {
|
|
34495
|
+
constructor(buffer) {
|
|
34496
|
+
this.pos = 0;
|
|
34497
|
+
this.buffer = buffer;
|
|
34498
|
+
}
|
|
34499
|
+
next() {
|
|
34500
|
+
return this.buffer.charCodeAt(this.pos++);
|
|
34501
|
+
}
|
|
34502
|
+
peek() {
|
|
34503
|
+
return this.buffer.charCodeAt(this.pos);
|
|
34504
|
+
}
|
|
34505
|
+
indexOf(char) {
|
|
34506
|
+
const { buffer, pos } = this;
|
|
34507
|
+
const idx = buffer.indexOf(char, pos);
|
|
34508
|
+
return idx === -1 ? buffer.length : idx;
|
|
34509
|
+
}
|
|
34510
|
+
};
|
|
34511
|
+
function decode(mappings) {
|
|
34512
|
+
const { length } = mappings;
|
|
34513
|
+
const reader = new StringReader(mappings);
|
|
34514
|
+
const decoded = [];
|
|
34515
|
+
let genColumn = 0;
|
|
34516
|
+
let sourcesIndex = 0;
|
|
34517
|
+
let sourceLine = 0;
|
|
34518
|
+
let sourceColumn = 0;
|
|
34519
|
+
let namesIndex = 0;
|
|
34520
|
+
do {
|
|
34521
|
+
const semi = reader.indexOf(";");
|
|
34522
|
+
const line = [];
|
|
34523
|
+
let sorted = true;
|
|
34524
|
+
let lastCol = 0;
|
|
34525
|
+
genColumn = 0;
|
|
34526
|
+
while (reader.pos < semi) {
|
|
34527
|
+
let seg;
|
|
34528
|
+
genColumn = decodeInteger(reader, genColumn);
|
|
34529
|
+
if (genColumn < lastCol) sorted = false;
|
|
34530
|
+
lastCol = genColumn;
|
|
34531
|
+
if (hasMoreVlq(reader, semi)) {
|
|
34532
|
+
sourcesIndex = decodeInteger(reader, sourcesIndex);
|
|
34533
|
+
sourceLine = decodeInteger(reader, sourceLine);
|
|
34534
|
+
sourceColumn = decodeInteger(reader, sourceColumn);
|
|
34535
|
+
if (hasMoreVlq(reader, semi)) {
|
|
34536
|
+
namesIndex = decodeInteger(reader, namesIndex);
|
|
34537
|
+
seg = [
|
|
34538
|
+
genColumn,
|
|
34539
|
+
sourcesIndex,
|
|
34540
|
+
sourceLine,
|
|
34541
|
+
sourceColumn,
|
|
34542
|
+
namesIndex
|
|
34543
|
+
];
|
|
34544
|
+
} else seg = [
|
|
34545
|
+
genColumn,
|
|
34546
|
+
sourcesIndex,
|
|
34547
|
+
sourceLine,
|
|
34548
|
+
sourceColumn
|
|
34549
|
+
];
|
|
34550
|
+
} else seg = [genColumn];
|
|
34551
|
+
line.push(seg);
|
|
34552
|
+
reader.pos++;
|
|
34553
|
+
}
|
|
34554
|
+
if (!sorted) sort(line);
|
|
34555
|
+
decoded.push(line);
|
|
34556
|
+
reader.pos = semi + 1;
|
|
34557
|
+
} while (reader.pos <= length);
|
|
34558
|
+
return decoded;
|
|
34559
|
+
}
|
|
34560
|
+
function sort(line) {
|
|
34561
|
+
line.sort(sortComparator);
|
|
34562
|
+
}
|
|
34563
|
+
function sortComparator(a, b) {
|
|
34564
|
+
return a[0] - b[0];
|
|
34565
|
+
}
|
|
34566
|
+
var COLUMN = 0;
|
|
34567
|
+
var SOURCES_INDEX = 1;
|
|
34568
|
+
var SOURCE_LINE = 2;
|
|
34569
|
+
var SOURCE_COLUMN = 3;
|
|
34570
|
+
var NAMES_INDEX = 4;
|
|
34571
|
+
var found = false;
|
|
34572
|
+
function binarySearch(haystack, needle, low, high) {
|
|
34573
|
+
while (low <= high) {
|
|
34574
|
+
const mid = low + (high - low >> 1);
|
|
34575
|
+
const cmp = haystack[mid][COLUMN] - needle;
|
|
34576
|
+
if (cmp === 0) {
|
|
34577
|
+
found = true;
|
|
34578
|
+
return mid;
|
|
34579
|
+
}
|
|
34580
|
+
if (cmp < 0) low = mid + 1;
|
|
34581
|
+
else high = mid - 1;
|
|
34582
|
+
}
|
|
34583
|
+
found = false;
|
|
34584
|
+
return low - 1;
|
|
34585
|
+
}
|
|
34586
|
+
function upperBound(haystack, needle, index) {
|
|
34587
|
+
for (let i = index + 1; i < haystack.length; index = i++) if (haystack[i][COLUMN] !== needle) break;
|
|
34588
|
+
return index;
|
|
34589
|
+
}
|
|
34590
|
+
function lowerBound(haystack, needle, index) {
|
|
34591
|
+
for (let i = index - 1; i >= 0; index = i--) if (haystack[i][COLUMN] !== needle) break;
|
|
34592
|
+
return index;
|
|
34593
|
+
}
|
|
34594
|
+
function memoizedBinarySearch(haystack, needle, state, key) {
|
|
34595
|
+
const { lastKey, lastNeedle, lastIndex } = state;
|
|
34596
|
+
let low = 0;
|
|
34597
|
+
let high = haystack.length - 1;
|
|
34598
|
+
if (key === lastKey) {
|
|
34599
|
+
if (needle === lastNeedle) {
|
|
34600
|
+
found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;
|
|
34601
|
+
return lastIndex;
|
|
34602
|
+
}
|
|
34603
|
+
if (needle >= lastNeedle) low = lastIndex === -1 ? 0 : lastIndex;
|
|
34604
|
+
else high = lastIndex;
|
|
34605
|
+
}
|
|
34606
|
+
state.lastKey = key;
|
|
34607
|
+
state.lastNeedle = needle;
|
|
34608
|
+
return state.lastIndex = binarySearch(haystack, needle, low, high);
|
|
34609
|
+
}
|
|
34610
|
+
var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)";
|
|
34611
|
+
var COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)";
|
|
34612
|
+
var LEAST_UPPER_BOUND = -1;
|
|
34613
|
+
var GREATEST_LOWER_BOUND = 1;
|
|
34614
|
+
function cast(map) {
|
|
34615
|
+
return map;
|
|
34616
|
+
}
|
|
34617
|
+
function decodedMappings(map) {
|
|
34618
|
+
var _a;
|
|
34619
|
+
return (_a = cast(map))._decoded || (_a._decoded = decode(cast(map)._encoded));
|
|
34620
|
+
}
|
|
34621
|
+
function originalPositionFor(map, needle) {
|
|
34622
|
+
let { line, column, bias } = needle;
|
|
34623
|
+
line--;
|
|
34624
|
+
if (line < 0) throw new Error(LINE_GTR_ZERO);
|
|
34625
|
+
if (column < 0) throw new Error(COL_GTR_EQ_ZERO);
|
|
34626
|
+
const decoded = decodedMappings(map);
|
|
34627
|
+
if (line >= decoded.length) return OMapping(null, null, null, null);
|
|
34628
|
+
const segments = decoded[line];
|
|
34629
|
+
const index = traceSegmentInternal(segments, cast(map)._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND);
|
|
34630
|
+
if (index === -1) return OMapping(null, null, null, null);
|
|
34631
|
+
const segment = segments[index];
|
|
34632
|
+
if (segment.length === 1) return OMapping(null, null, null, null);
|
|
34633
|
+
const { names, resolvedSources } = map;
|
|
34634
|
+
return OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null);
|
|
34635
|
+
}
|
|
34636
|
+
function OMapping(source, line, column, name) {
|
|
34637
|
+
return {
|
|
34638
|
+
source,
|
|
34639
|
+
line,
|
|
34640
|
+
column,
|
|
34641
|
+
name
|
|
34642
|
+
};
|
|
34643
|
+
}
|
|
34644
|
+
function traceSegmentInternal(segments, memo, line, column, bias) {
|
|
34645
|
+
let index = memoizedBinarySearch(segments, column, memo, line);
|
|
34646
|
+
if (found) index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
|
|
34647
|
+
else if (bias === LEAST_UPPER_BOUND) index++;
|
|
34648
|
+
if (index === -1 || index === segments.length) return -1;
|
|
34649
|
+
return index;
|
|
34650
|
+
}
|
|
34651
|
+
const CHROME_IE_STACK_REGEXP = /^\s*at .*(?:\S:\d+|\(native\))/m;
|
|
34652
|
+
const SAFARI_NATIVE_CODE_REGEXP = /^(?:eval@)?(?:\[native code\])?$/;
|
|
34653
|
+
const stackIgnorePatterns = [
|
|
34654
|
+
"node:internal",
|
|
34655
|
+
/\/packages\/\w+\/dist\//,
|
|
34656
|
+
/\/@vitest\/\w+\/dist\//,
|
|
34657
|
+
"/vitest/dist/",
|
|
34658
|
+
"/vitest/src/",
|
|
34659
|
+
"/node_modules/chai/",
|
|
34660
|
+
"/node_modules/tinyspy/",
|
|
34661
|
+
"/vite/dist/node/module-runner",
|
|
34662
|
+
"/rolldown-vite/dist/node/module-runner",
|
|
34663
|
+
"/deps/chunk-",
|
|
34664
|
+
"/deps/@vitest",
|
|
34665
|
+
"/deps/loupe",
|
|
34666
|
+
"/deps/chai",
|
|
34667
|
+
"/browser-playwright/dist/locators.js",
|
|
34668
|
+
"/browser-webdriverio/dist/locators.js",
|
|
34669
|
+
"/browser-preview/dist/locators.js",
|
|
34670
|
+
/node:\w+/,
|
|
34671
|
+
/__vitest_test__/,
|
|
34672
|
+
/__vitest_browser__/,
|
|
34673
|
+
"/@id/__x00__vitest/browser",
|
|
34674
|
+
/\/deps\/vitest_/
|
|
34675
|
+
];
|
|
34676
|
+
const NOW_LENGTH = Date.now().toString().length;
|
|
34677
|
+
const REGEXP_VITEST = new RegExp(`vitest=\\d{${NOW_LENGTH}}`);
|
|
34678
|
+
function extractLocation(urlLike) {
|
|
34679
|
+
if (!urlLike.includes(":")) return [urlLike];
|
|
34680
|
+
const parts = /(.+?)(?::(\d+))?(?::(\d+))?$/.exec(urlLike.replace(/^\(|\)$/g, ""));
|
|
34681
|
+
if (!parts) return [urlLike];
|
|
34682
|
+
let url = parts[1];
|
|
34683
|
+
if (url.startsWith("async ")) url = url.slice(6);
|
|
34684
|
+
if (url.startsWith("http:") || url.startsWith("https:")) {
|
|
34685
|
+
const urlObj = new URL(url);
|
|
34686
|
+
urlObj.searchParams.delete("import");
|
|
34687
|
+
urlObj.searchParams.delete("browserv");
|
|
34688
|
+
url = urlObj.pathname + urlObj.hash + urlObj.search;
|
|
34689
|
+
}
|
|
34690
|
+
if (url.startsWith("/@fs/")) {
|
|
34691
|
+
const isWindows = /^\/@fs\/[a-zA-Z]:\//.test(url);
|
|
34692
|
+
url = url.slice(isWindows ? 5 : 4);
|
|
34693
|
+
}
|
|
34694
|
+
if (url.includes("vitest=")) url = url.replace(REGEXP_VITEST, "").replace(/[?&]$/, "");
|
|
34695
|
+
return [
|
|
34696
|
+
url,
|
|
34697
|
+
parts[2] || void 0,
|
|
34698
|
+
parts[3] || void 0
|
|
34699
|
+
];
|
|
34700
|
+
}
|
|
34701
|
+
function parseSingleFFOrSafariStack(raw) {
|
|
34702
|
+
let line = raw.trim();
|
|
34703
|
+
if (SAFARI_NATIVE_CODE_REGEXP.test(line)) return null;
|
|
34704
|
+
if (line.includes(" > eval")) line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1");
|
|
34705
|
+
if (!line.includes("@")) return null;
|
|
34706
|
+
let atIndex = -1;
|
|
34707
|
+
let locationPart = "";
|
|
34708
|
+
let functionName;
|
|
34709
|
+
for (let i = 0; i < line.length; i++) if (line[i] === "@") {
|
|
34710
|
+
const candidateLocation = line.slice(i + 1);
|
|
34711
|
+
if (candidateLocation.includes(":") && candidateLocation.length >= 3) {
|
|
34712
|
+
atIndex = i;
|
|
34713
|
+
locationPart = candidateLocation;
|
|
34714
|
+
functionName = i > 0 ? line.slice(0, i) : void 0;
|
|
34715
|
+
break;
|
|
34716
|
+
}
|
|
34717
|
+
}
|
|
34718
|
+
if (atIndex === -1 || !locationPart.includes(":") || locationPart.length < 3) return null;
|
|
34719
|
+
const [url, lineNumber, columnNumber] = extractLocation(locationPart);
|
|
34720
|
+
if (!url || !lineNumber || !columnNumber) return null;
|
|
34721
|
+
return {
|
|
34722
|
+
file: url,
|
|
34723
|
+
method: functionName || "",
|
|
34724
|
+
line: Number.parseInt(lineNumber),
|
|
34725
|
+
column: Number.parseInt(columnNumber)
|
|
34726
|
+
};
|
|
34727
|
+
}
|
|
34728
|
+
function parseSingleV8Stack(raw) {
|
|
34729
|
+
let line = raw.trim();
|
|
34730
|
+
if (!CHROME_IE_STACK_REGEXP.test(line)) return null;
|
|
34731
|
+
if (line.includes("(eval ")) line = line.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, "");
|
|
34732
|
+
let sanitizedLine = line.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, "");
|
|
34733
|
+
const location = sanitizedLine.match(/ (\(.+\)$)/);
|
|
34734
|
+
sanitizedLine = location ? sanitizedLine.replace(location[0], "") : sanitizedLine;
|
|
34735
|
+
const [url, lineNumber, columnNumber] = extractLocation(location ? location[1] : sanitizedLine);
|
|
34736
|
+
let method = location && sanitizedLine || "";
|
|
34737
|
+
let file = url && ["eval", "<anonymous>"].includes(url) ? void 0 : url;
|
|
34738
|
+
if (!file || !lineNumber || !columnNumber) return null;
|
|
34739
|
+
if (method.startsWith("async ")) method = method.slice(6);
|
|
34740
|
+
if (file.startsWith("file://")) file = file.slice(7);
|
|
34741
|
+
file = file.startsWith("node:") || file.startsWith("internal:") ? file : resolve$2(file);
|
|
34742
|
+
if (method) method = method.replace(/\(0\s?,\s?__vite_ssr_import_\d+__.(\w+)\)/g, "$1").replace(/__(vite_ssr_import|vi_import)_\d+__\./g, "").replace(/(Object\.)?__vite_ssr_export_default__\s?/g, "");
|
|
34743
|
+
return {
|
|
34744
|
+
method,
|
|
34745
|
+
file,
|
|
34746
|
+
line: Number.parseInt(lineNumber),
|
|
34747
|
+
column: Number.parseInt(columnNumber)
|
|
34748
|
+
};
|
|
34749
|
+
}
|
|
34750
|
+
function parseStacktrace(stack, options = {}) {
|
|
34751
|
+
const { ignoreStackEntries = stackIgnorePatterns } = options;
|
|
34752
|
+
let stacks = !CHROME_IE_STACK_REGEXP.test(stack) ? parseFFOrSafariStackTrace(stack) : parseV8Stacktrace(stack);
|
|
34753
|
+
const helperIndex = stacks.findLastIndex((s) => s.method === "__VITEST_HELPER__" || s.method === "async*__VITEST_HELPER__");
|
|
34754
|
+
if (helperIndex >= 0) stacks = stacks.slice(helperIndex + 1);
|
|
34755
|
+
return stacks.map((stack) => {
|
|
34756
|
+
if (options.getUrlId) stack.file = options.getUrlId(stack.file);
|
|
34757
|
+
const map = options.getSourceMap?.(stack.file);
|
|
34758
|
+
if (!map || typeof map !== "object" || !map.version) return shouldFilter(ignoreStackEntries, stack.file) ? null : stack;
|
|
34759
|
+
const position = getOriginalPosition(new DecodedMap(map, stack.file), stack);
|
|
34760
|
+
if (!position) return stack;
|
|
34761
|
+
const { line, column, source, name } = position;
|
|
34762
|
+
let file = source || stack.file;
|
|
34763
|
+
if (file.match(/\/\w:\//)) file = file.slice(1);
|
|
34764
|
+
if (shouldFilter(ignoreStackEntries, file)) return null;
|
|
34765
|
+
if (line != null && column != null) return {
|
|
34766
|
+
line,
|
|
34767
|
+
column,
|
|
34768
|
+
file,
|
|
34769
|
+
method: name || stack.method
|
|
34770
|
+
};
|
|
34771
|
+
return stack;
|
|
34772
|
+
}).filter((s) => s != null);
|
|
34773
|
+
}
|
|
34774
|
+
function shouldFilter(ignoreStackEntries, file) {
|
|
34775
|
+
return ignoreStackEntries.some((p) => file.match(p));
|
|
34776
|
+
}
|
|
34777
|
+
function parseFFOrSafariStackTrace(stack) {
|
|
34778
|
+
return stack.split("\n").map((line) => parseSingleFFOrSafariStack(line)).filter(notNullish);
|
|
34779
|
+
}
|
|
34780
|
+
function parseV8Stacktrace(stack) {
|
|
34781
|
+
return stack.split("\n").map((line) => parseSingleV8Stack(line)).filter(notNullish);
|
|
34782
|
+
}
|
|
34783
|
+
function parseErrorStacktrace(e, options = {}) {
|
|
34784
|
+
if (!e || isPrimitive(e)) return [];
|
|
34785
|
+
if ("stacks" in e && e.stacks) return e.stacks;
|
|
34786
|
+
const stackStr = e.stack || "";
|
|
34787
|
+
let stackFrames = typeof stackStr === "string" ? parseStacktrace(stackStr, options) : [];
|
|
34788
|
+
if (!stackFrames.length) {
|
|
34789
|
+
const e_ = e;
|
|
34790
|
+
if (e_.fileName != null && e_.lineNumber != null && e_.columnNumber != null) stackFrames = parseStacktrace(`${e_.fileName}:${e_.lineNumber}:${e_.columnNumber}`, options);
|
|
34791
|
+
if (e_.sourceURL != null && e_.line != null && e_._column != null) stackFrames = parseStacktrace(`${e_.sourceURL}:${e_.line}:${e_.column}`, options);
|
|
34792
|
+
}
|
|
34793
|
+
if (options.frameFilter) stackFrames = stackFrames.filter((f) => options.frameFilter(e, f) !== false);
|
|
34794
|
+
e.stacks = stackFrames;
|
|
34795
|
+
return stackFrames;
|
|
34796
|
+
}
|
|
34797
|
+
var DecodedMap = class {
|
|
34798
|
+
_encoded;
|
|
34799
|
+
_decoded;
|
|
34800
|
+
_decodedMemo;
|
|
34801
|
+
url;
|
|
34802
|
+
version;
|
|
34803
|
+
names = [];
|
|
34804
|
+
resolvedSources;
|
|
34805
|
+
constructor(map, from) {
|
|
34806
|
+
this.map = map;
|
|
34807
|
+
const { mappings, names, sources } = map;
|
|
34808
|
+
this.version = map.version;
|
|
34809
|
+
this.names = names || [];
|
|
34810
|
+
this._encoded = mappings || "";
|
|
34811
|
+
this._decodedMemo = memoizedState();
|
|
34812
|
+
this.url = from;
|
|
34813
|
+
this.resolvedSources = (sources || []).map((s) => resolve$2(from, "..", s || ""));
|
|
34814
|
+
}
|
|
34815
|
+
};
|
|
34816
|
+
function memoizedState() {
|
|
34817
|
+
return {
|
|
34818
|
+
lastKey: -1,
|
|
34819
|
+
lastNeedle: -1,
|
|
34820
|
+
lastIndex: -1
|
|
34821
|
+
};
|
|
34822
|
+
}
|
|
34823
|
+
function getOriginalPosition(map, needle) {
|
|
34824
|
+
const result = originalPositionFor(map, needle);
|
|
34825
|
+
if (result.column == null) return null;
|
|
34826
|
+
return result;
|
|
34827
|
+
}
|
|
34828
|
+
//#endregion
|
|
34829
|
+
//#region ../../rolldown-vite/packages/vite/src/node/plugins/forwardConsole.ts
|
|
34830
|
+
function forwardConsolePlugin(pluginOpts) {
|
|
34831
|
+
const sourceMapCache = /* @__PURE__ */ new Map();
|
|
34832
|
+
return {
|
|
34833
|
+
name: "vite:forward-console",
|
|
34834
|
+
apply: "serve",
|
|
34835
|
+
configureServer(server) {
|
|
34836
|
+
for (const name of pluginOpts.environments) {
|
|
34837
|
+
const environment = server.environments[name];
|
|
34838
|
+
environment.hot.on("vite:forward-console", (payload) => {
|
|
34839
|
+
if (payload.type === "error" || payload.type === "unhandled-rejection") {
|
|
34840
|
+
const output = formatError(payload, environment, sourceMapCache);
|
|
34841
|
+
environment.config.logger.error(output, { timestamp: true });
|
|
34842
|
+
} else {
|
|
34843
|
+
const output = import_picocolors.default.dim(`[console.${payload.data.level}] `) + payload.data.message;
|
|
34844
|
+
if (payload.data.level === "error") environment.config.logger.error(output, { timestamp: true });
|
|
34845
|
+
else if (payload.data.level === "warn") environment.config.logger.warn(output, { timestamp: true });
|
|
34846
|
+
else environment.config.logger.info(output, { timestamp: true });
|
|
34847
|
+
}
|
|
34848
|
+
});
|
|
34849
|
+
}
|
|
34850
|
+
}
|
|
34851
|
+
};
|
|
34852
|
+
}
|
|
34853
|
+
function formatError(payload, environment, sourceMapCache) {
|
|
34854
|
+
const error = payload.data;
|
|
34855
|
+
const stacks = parseErrorStacktrace(error, {
|
|
34856
|
+
getUrlId(id) {
|
|
34857
|
+
const moduleGraph = environment.moduleGraph;
|
|
34858
|
+
if (moduleGraph.getModuleById(id)) return id;
|
|
34859
|
+
const resolvedPath = normalizePath$1(path.resolve(environment.config.root, id.slice(1)));
|
|
34860
|
+
if (moduleGraph.getModuleById(resolvedPath)) return resolvedPath;
|
|
34861
|
+
const files = moduleGraph.getModulesByFile(resolvedPath);
|
|
34862
|
+
if (files && files.size) return files.values().next().value.id;
|
|
34863
|
+
return id;
|
|
34864
|
+
},
|
|
34865
|
+
getSourceMap(id) {
|
|
34866
|
+
if (sourceMapCache.has(id)) return sourceMapCache.get(id);
|
|
34867
|
+
const result = environment.moduleGraph.getModuleById(id)?.transformResult;
|
|
34868
|
+
if (result && !result.map) try {
|
|
34869
|
+
const filePath = id.split("?")[0];
|
|
34870
|
+
const extracted = extractSourcemapFromFile(result.code, filePath);
|
|
34871
|
+
sourceMapCache.set(id, extracted?.map);
|
|
34872
|
+
return extracted?.map;
|
|
34873
|
+
} catch {
|
|
34874
|
+
sourceMapCache.set(id, null);
|
|
34875
|
+
return null;
|
|
34876
|
+
}
|
|
34877
|
+
sourceMapCache.set(id, result?.map);
|
|
34878
|
+
return result?.map;
|
|
34879
|
+
},
|
|
34880
|
+
ignoreStackEntries: []
|
|
34881
|
+
});
|
|
34882
|
+
const nearest = stacks.find((stack) => {
|
|
34883
|
+
return [...environment.moduleGraph.getModulesByFile(stack.file) || []].some((m) => m.transformResult) && fs.existsSync(stack.file);
|
|
34884
|
+
});
|
|
34885
|
+
let output = "";
|
|
34886
|
+
output += import_picocolors.default.red(`${payload.type === "unhandled-rejection" ? "[Unhandled rejection]" : "[Unhandled error]"} ${import_picocolors.default.bold(error.name)}: ${error.message}\n`);
|
|
34887
|
+
for (const stack of stacks) {
|
|
34888
|
+
const file = normalizePath$1(path.relative(environment.config.root, stack.file));
|
|
34889
|
+
output += ` > ${[stack.method, `${file}:${stack.line}:${stack.column}`].filter(Boolean).join(" ")}\n`;
|
|
34890
|
+
if (stack === nearest) {
|
|
34891
|
+
const code = fs.readFileSync(stack.file, "utf-8");
|
|
34892
|
+
output += generateCodeFrame(code, stack).replace(/^/gm, " ");
|
|
34893
|
+
output += "\n";
|
|
34894
|
+
}
|
|
34895
|
+
}
|
|
34896
|
+
return output;
|
|
34897
|
+
}
|
|
34898
|
+
//#endregion
|
|
34556
34899
|
//#region ../../rolldown-vite/packages/vite/src/node/plugins/esbuildBannerFooterCompatPlugin.ts
|
|
34557
34900
|
/**
|
|
34558
34901
|
* This plugin supports `esbuild.banner` and `esbuild.footer` options.
|
|
@@ -34598,12 +34941,11 @@ async function resolvePlugins(config, prePlugins, normalPlugins, postPlugins) {
|
|
|
34598
34941
|
post: []
|
|
34599
34942
|
};
|
|
34600
34943
|
const { modulePreload } = config.build;
|
|
34601
|
-
const enableNativePluginV1 = config.nativePluginEnabledLevel >= 1;
|
|
34602
34944
|
return [
|
|
34603
34945
|
!isBundled ? optimizedDepsPlugin() : null,
|
|
34604
34946
|
!isWorker ? watchPackageDataPlugin(config.packageCache) : null,
|
|
34605
34947
|
!isBundled ? preAliasPlugin(config) : null,
|
|
34606
|
-
isBundled &&
|
|
34948
|
+
isBundled && !config.resolve.alias.some((v) => v.customResolver) ? viteAliasPlugin({ entries: config.resolve.alias.map((item) => {
|
|
34607
34949
|
return {
|
|
34608
34950
|
find: item.find,
|
|
34609
34951
|
replacement: item.replacement
|
|
@@ -34639,6 +34981,7 @@ async function resolvePlugins(config, prePlugins, normalPlugins, postPlugins) {
|
|
|
34639
34981
|
wasmHelperPlugin(),
|
|
34640
34982
|
webWorkerPlugin(config),
|
|
34641
34983
|
assetPlugin(config),
|
|
34984
|
+
config.server.forwardConsole.enabled && forwardConsolePlugin({ environments: ["client"] }),
|
|
34642
34985
|
...normalPlugins,
|
|
34643
34986
|
viteWasmFallbackPlugin(),
|
|
34644
34987
|
definePlugin(config),
|
|
@@ -35274,7 +35617,7 @@ var PluginContext = class extends MinimalPluginContext {
|
|
|
35274
35617
|
if (this instanceof TransformPluginContext && typeof err.loc?.line === "number" && typeof err.loc.column === "number") {
|
|
35275
35618
|
const rawSourceMap = this._getCombinedSourcemap();
|
|
35276
35619
|
if (rawSourceMap && "version" in rawSourceMap) {
|
|
35277
|
-
const { source, line, column } = originalPositionFor$
|
|
35620
|
+
const { source, line, column } = originalPositionFor$2(new TraceMap(rawSourceMap), {
|
|
35278
35621
|
line: Number(err.loc.line),
|
|
35279
35622
|
column: Number(err.loc.column)
|
|
35280
35623
|
});
|
|
@@ -35954,6 +36297,13 @@ function rolldownDepPlugin(environment, qualified, external) {
|
|
|
35954
36297
|
const allExternalTypes = extensions ? externalTypes.filter((type) => !extensions.includes("." + type)) : externalTypes;
|
|
35955
36298
|
const esmPackageCache = /* @__PURE__ */ new Map();
|
|
35956
36299
|
const cjsPackageCache = /* @__PURE__ */ new Map();
|
|
36300
|
+
const resolveAssets = (resolved, kind) => {
|
|
36301
|
+
if (kind === "require-call") return { id: externalWithConversionNamespace + resolved };
|
|
36302
|
+
return {
|
|
36303
|
+
id: resolved,
|
|
36304
|
+
external: "absolute"
|
|
36305
|
+
};
|
|
36306
|
+
};
|
|
35957
36307
|
const _resolve = createBackCompatIdResolver(environment.getTopLevelConfig(), {
|
|
35958
36308
|
asSrc: false,
|
|
35959
36309
|
scan: true,
|
|
@@ -35969,9 +36319,10 @@ function rolldownDepPlugin(environment, qualified, external) {
|
|
|
35969
36319
|
const _importer = importer && importer in qualified ? qualified[importer] : importer;
|
|
35970
36320
|
return (kind.startsWith("require") ? _resolveRequire : _resolve)(environment, id, _importer);
|
|
35971
36321
|
};
|
|
35972
|
-
const resolveResult = (id, resolved) => {
|
|
36322
|
+
const resolveResult = (id, resolved, kind) => {
|
|
35973
36323
|
if (resolved.startsWith("__vite-browser-external")) return { id: browserExternalNamespace + id };
|
|
35974
36324
|
if (resolved.startsWith("__vite-optional-peer-dep")) return { id: optionalPeerDepNamespace + resolved };
|
|
36325
|
+
if (allExternalTypesReg.test(resolved)) return resolveAssets(resolved, kind);
|
|
35975
36326
|
if (isBuiltin(environment.config.resolve.builtins, resolved)) return;
|
|
35976
36327
|
if (isExternalUrl(resolved)) return {
|
|
35977
36328
|
id: resolved,
|
|
@@ -36001,11 +36352,7 @@ function rolldownDepPlugin(environment, qualified, external) {
|
|
|
36001
36352
|
id: isWindows ? resolved.replaceAll("/", "\\") : resolved,
|
|
36002
36353
|
external: false
|
|
36003
36354
|
};
|
|
36004
|
-
|
|
36005
|
-
return {
|
|
36006
|
-
id: resolved,
|
|
36007
|
-
external: "absolute"
|
|
36008
|
-
};
|
|
36355
|
+
return resolveAssets(resolved, kind);
|
|
36009
36356
|
}
|
|
36010
36357
|
}
|
|
36011
36358
|
},
|
|
@@ -36038,7 +36385,7 @@ function rolldownDepPlugin(environment, qualified, external) {
|
|
|
36038
36385
|
if (aliased && (entry = resolveEntry(aliased))) return entry;
|
|
36039
36386
|
}
|
|
36040
36387
|
const resolved = await resolve(id, importer, kind);
|
|
36041
|
-
if (resolved) return resolveResult(id, resolved);
|
|
36388
|
+
if (resolved) return resolveResult(id, resolved, kind);
|
|
36042
36389
|
}
|
|
36043
36390
|
},
|
|
36044
36391
|
load: {
|
|
@@ -37665,7 +38012,7 @@ async function resolveBuildPlugins(config) {
|
|
|
37665
38012
|
...isBuild ? [terserPlugin(config)] : [],
|
|
37666
38013
|
...isBuild && !config.isWorker ? [
|
|
37667
38014
|
licensePlugin(),
|
|
37668
|
-
manifestPlugin(
|
|
38015
|
+
manifestPlugin(),
|
|
37669
38016
|
ssrManifestPlugin(),
|
|
37670
38017
|
buildReporterPlugin(config)
|
|
37671
38018
|
] : [],
|
|
@@ -37724,13 +38071,6 @@ function resolveRolldownOptions(environment, chunkMetadataMap) {
|
|
|
37724
38071
|
experimental: {
|
|
37725
38072
|
...options.rollupOptions.experimental,
|
|
37726
38073
|
viteMode: true
|
|
37727
|
-
},
|
|
37728
|
-
optimization: {
|
|
37729
|
-
inlineConst: typeof options.rollupOptions.optimization?.inlineConst === "boolean" ? options.rollupOptions.optimization.inlineConst : {
|
|
37730
|
-
mode: "smart",
|
|
37731
|
-
...options.rollupOptions.optimization?.inlineConst
|
|
37732
|
-
},
|
|
37733
|
-
...options.rollupOptions.optimization
|
|
37734
38074
|
}
|
|
37735
38075
|
};
|
|
37736
38076
|
const isSsrTargetWebworkerEnvironment = environment.name === "ssr" && environment.getTopLevelConfig().ssr?.target === "webworker";
|
|
@@ -37752,7 +38092,7 @@ function resolveRolldownOptions(environment, chunkMetadataMap) {
|
|
|
37752
38092
|
assetFileNames: libOptions ? `[name].[ext]` : path.posix.join(options.assetsDir, `[name]-[hash].[ext]`),
|
|
37753
38093
|
codeSplitting: output.codeSplitting ?? (output.format === "umd" || output.format === "iife" || isSsrTargetWebworkerEnvironment && (typeof input === "string" || Object.keys(input).length === 1) ? false : void 0),
|
|
37754
38094
|
comments: typeof output.comments === "boolean" ? output.comments : {
|
|
37755
|
-
annotation: !options.minify,
|
|
38095
|
+
annotation: !options.minify || libOptions && (format === "es" || format === "esm"),
|
|
37756
38096
|
jsdoc: !options.minify,
|
|
37757
38097
|
legal: !options.minify,
|
|
37758
38098
|
...output.comments
|
|
@@ -37797,7 +38137,7 @@ async function buildEnvironment(environment) {
|
|
|
37797
38137
|
watch: {
|
|
37798
38138
|
...rollupOptions.watch,
|
|
37799
38139
|
...options.watch,
|
|
37800
|
-
|
|
38140
|
+
watcher: convertToWatcherOptions(resolvedChokidarOptions)
|
|
37801
38141
|
}
|
|
37802
38142
|
});
|
|
37803
38143
|
watcher.on("event", (event) => {
|
|
@@ -38786,7 +39126,6 @@ const configDefaults = Object.freeze({
|
|
|
38786
39126
|
importGlobRestoreExtension: false,
|
|
38787
39127
|
renderBuiltUrl: void 0,
|
|
38788
39128
|
hmrPartialAccept: false,
|
|
38789
|
-
enableNativePlugin: process.env._VITE_TEST_JS_PLUGIN ? false : "v2",
|
|
38790
39129
|
bundledDev: false
|
|
38791
39130
|
},
|
|
38792
39131
|
future: {
|
|
@@ -39122,7 +39461,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
|
39122
39461
|
const assetsFilter = config.assetsInclude && (!Array.isArray(config.assetsInclude) || config.assetsInclude.length) ? createFilter$1(config.assetsInclude) : () => false;
|
|
39123
39462
|
const { publicDir } = config;
|
|
39124
39463
|
const resolvedPublicDir = publicDir !== false && publicDir !== "" ? normalizePath$1(path.resolve(resolvedRoot, typeof publicDir === "string" ? publicDir : configDefaults.publicDir)) : "";
|
|
39125
|
-
const server = resolveServerOptions(resolvedRoot, config.server, logger);
|
|
39464
|
+
const server = await resolveServerOptions(resolvedRoot, config.server, logger);
|
|
39126
39465
|
const builder = resolveBuilderOptions(config.builder);
|
|
39127
39466
|
const BASE_URL = resolvedBase;
|
|
39128
39467
|
const resolvedConfigContext = new BasicMinimalPluginContext({
|
|
@@ -39271,7 +39610,6 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
|
39271
39610
|
dot: true
|
|
39272
39611
|
}),
|
|
39273
39612
|
safeModulePaths: /* @__PURE__ */ new Set(),
|
|
39274
|
-
nativePluginEnabledLevel: resolveNativePluginEnabledLevel(experimental.enableNativePlugin),
|
|
39275
39613
|
[SYMBOL_RESOLVED_CONFIG]: true
|
|
39276
39614
|
};
|
|
39277
39615
|
resolved = {
|
|
@@ -39319,15 +39657,6 @@ assetFileNames isn't equal for every build.rollupOptions.output. A single patter
|
|
|
39319
39657
|
`));
|
|
39320
39658
|
return resolved;
|
|
39321
39659
|
}
|
|
39322
|
-
function resolveNativePluginEnabledLevel(enableNativePlugin) {
|
|
39323
|
-
switch (enableNativePlugin) {
|
|
39324
|
-
case "v1": return 1;
|
|
39325
|
-
case "v2":
|
|
39326
|
-
case true: return 2;
|
|
39327
|
-
case false: return -1;
|
|
39328
|
-
default: return -1;
|
|
39329
|
-
}
|
|
39330
|
-
}
|
|
39331
39660
|
/**
|
|
39332
39661
|
* Resolve base url. Note that some users use Vite to build for non-web targets like
|
|
39333
39662
|
* electron or expects to deploy
|
|
@@ -39659,4 +39988,4 @@ const parseAst$1 = parseAst;
|
|
|
39659
39988
|
const parseAstAsync$1 = parseAstAsync;
|
|
39660
39989
|
const esbuildVersion = "0.25.0";
|
|
39661
39990
|
//#endregion
|
|
39662
|
-
export { depsFromOptimizedDepInfo as $, builderOptionsDefaults as A,
|
|
39991
|
+
export { depsFromOptimizedDepInfo as $, builderOptionsDefaults as A, searchForWorkspaceRoot as At, resolveBuilderOptions as B, transformWithEsbuild as Bt, resolvePreviewOptions as C, send as Ct, ChunkMetadataMap as D, fetchModule as Dt, BuildEnvironment as E, isFileServingAllowed as Et, injectEnvironmentToHooks as F, createServerModuleRunnerTransport as Ft, toOutputFilePathInHtml as G, mergeConfig as Gt, resolveRolldownOptions as H, createFilter$1 as Ht, onRollupLog as I, buildErrorMessage as It, addManuallyIncludedOptimizeDeps as J, rollupVersion as Jt, toOutputFilePathInJS as K, normalizePath$1 as Kt, resolveBuildEnvironmentOptions as L, loadEnv as Lt, createBuilder as M, perEnvironmentState as Mt, createToImportMetaURLBasedRelativeRuntime as N, ssrTransform as Nt, build as O, formatPostcssSourceMap as Ot, enhanceRollupError as P, createServerModuleRunner as Pt, createIsOptimizedDepUrl as Q, resolveBuildOutputs as R, resolveEnvPrefix as Rt, preview as S, serverConfigDefaults as St, isRunnableDevEnvironment as T, isFileLoadingAllowed as Tt, resolveUserExternal as U, isCSSRequest as Ut, resolveLibFilename as V, perEnvironmentPlugin as Vt, toOutputFilePathInCss as W, mergeAlias as Wt, cleanupDepsCacheStaleDirs as X, addOptimizedDepInfo as Y, withFilter as Yt, createIsOptimizedDepFile as Z, resolveConfig as _, createServer$2 as _t, minifySync as a, initDepsOptimizerMetadata as at, sortUserPlugins as b, resolveServerOptions as bt, parseAstAsync$1 as c, optimizeDeps as ct, isFetchableDevEnvironment as d, optimizedDepInfoFromId as dt, depsLogString as et, defineConfig as f, optimizedDepNeedsInterop as ft, resolveBaseUrl as g, _createServer as gt, loadConfigFromFile as h, createServerHotChannel as ht, minify as i, getOptimizedDepPath as it, clearLine as j, createIdResolver as jt, buildEnvironmentOptionsDefaults as k, preprocessCSS as kt, parseSync as l, optimizeExplicitEnvironmentDeps as lt, isResolvedConfig as m, toDiscoveredDependencies as mt, esbuildVersion as n, extractExportsData as nt, parse as o, isDepOptimizationDisabled as ot, getDefaultEnvironmentOptions as p, runOptimizeDeps as pt, toOutputFilePathWithoutRuntime as q, rolldownVersion as qt, esmExternalRequirePlugin as r, getDepsCacheDir as rt, parseAst$1 as s, loadCachedDepOptimizationMetadata as st, Visitor as t, discoverProjectDependencies as tt, createFetchableDevEnvironment as u, optimizedDepInfoFromFile as ut, resolveDevEnvironmentOptions as v, createServerCloseFn as vt, createRunnableDevEnvironment as w, DevEnvironment as wt, runnerImport as x, restartServerWithUrls as xt, resolveDevToolsConfig as y, resolveForwardConsoleOptions as yt, resolveBuildPlugins as z, transformWithOxc as zt };
|