vite 6.0.0-beta.1 → 6.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +66 -1010
- package/README.md +4 -4
- package/bin/vite.js +5 -0
- package/client.d.ts +10 -0
- package/dist/client/client.mjs +344 -105
- package/dist/node/chunks/{dep-IQS-Za7F.js → dep-3RmXg9uo.js} +0 -8
- package/dist/node/chunks/{dep-DiM5uMHt.js → dep-Ck0pJQmh.js} +4 -175
- package/dist/node/chunks/{dep-BZ_CwQkz.js → dep-DiRA7B7B.js} +15738 -30463
- package/dist/node/chunks/{dep-D-7KCb9p.js → dep-DnSxfB-q.js} +704 -443
- package/dist/node/chunks/{dep-BZeeNeMJ.js → dep-ifLmJA8Z.js} +286 -127
- package/dist/node/cli.js +21 -37
- package/dist/node/constants.js +19 -11
- package/dist/node/index.d.ts +1649 -1602
- package/dist/node/index.js +13 -153
- package/dist/node/module-runner.d.ts +154 -141
- package/dist/node/module-runner.js +374 -221
- package/dist/node-cjs/publicUtils.cjs +363 -184
- package/index.cjs +35 -3
- package/index.d.cts +1 -1
- package/package.json +44 -33
- package/types/hmrPayload.d.ts +5 -0
- package/types/internal/cssPreprocessorOptions.d.ts +63 -0
- package/types/internal/lightningcssOptions.d.ts +18 -0
@@ -1,32 +1,52 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var path$
|
3
|
+
var path$1 = require('node:path');
|
4
4
|
var node_url = require('node:url');
|
5
5
|
var fs$1 = require('node:fs');
|
6
6
|
var esbuild = require('esbuild');
|
7
|
+
var node_child_process = require('node:child_process');
|
7
8
|
var node_module = require('node:module');
|
8
9
|
var require$$0 = require('tty');
|
9
10
|
var require$$1 = require('util');
|
10
|
-
var require$$
|
11
|
-
var require$$0$
|
12
|
-
var
|
11
|
+
var require$$1$1 = require('path');
|
12
|
+
var require$$0$1 = require('crypto');
|
13
|
+
var require$$1$2 = require('fs');
|
13
14
|
var readline = require('node:readline');
|
14
15
|
var require$$2 = require('os');
|
15
16
|
|
16
17
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
17
18
|
const { version: version$2 } = JSON.parse(
|
18
|
-
fs$1.readFileSync(new URL("../../package.json", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href)))).toString()
|
19
|
+
fs$1.readFileSync(new URL("../../package.json", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href)))).toString()
|
19
20
|
);
|
20
21
|
const VERSION = version$2;
|
22
|
+
const DEFAULT_MAIN_FIELDS = [
|
23
|
+
"browser",
|
24
|
+
"module",
|
25
|
+
"jsnext:main",
|
26
|
+
// moment still uses this...
|
27
|
+
"jsnext"
|
28
|
+
];
|
29
|
+
const DEFAULT_CLIENT_MAIN_FIELDS = Object.freeze(DEFAULT_MAIN_FIELDS);
|
30
|
+
const DEFAULT_SERVER_MAIN_FIELDS = Object.freeze(
|
31
|
+
DEFAULT_MAIN_FIELDS.filter((f) => f !== "browser")
|
32
|
+
);
|
33
|
+
const DEV_PROD_CONDITION = `development|production`;
|
34
|
+
const DEFAULT_CONDITIONS = ["module", "browser", "node", DEV_PROD_CONDITION];
|
35
|
+
const DEFAULT_CLIENT_CONDITIONS = Object.freeze(
|
36
|
+
DEFAULT_CONDITIONS.filter((c) => c !== "node")
|
37
|
+
);
|
38
|
+
const DEFAULT_SERVER_CONDITIONS = Object.freeze(
|
39
|
+
DEFAULT_CONDITIONS.filter((c) => c !== "browser")
|
40
|
+
);
|
21
41
|
const FS_PREFIX = `/@fs/`;
|
22
|
-
const VITE_PACKAGE_DIR = path$
|
42
|
+
const VITE_PACKAGE_DIR = path$1.resolve(
|
23
43
|
// import.meta.url is `dist/node/constants.js` after bundle
|
24
|
-
node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href))),
|
44
|
+
node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href))),
|
25
45
|
"../../.."
|
26
46
|
);
|
27
|
-
const CLIENT_ENTRY = path$
|
28
|
-
path$
|
29
|
-
path$
|
47
|
+
const CLIENT_ENTRY = path$1.resolve(VITE_PACKAGE_DIR, "dist/client/client.mjs");
|
48
|
+
path$1.resolve(VITE_PACKAGE_DIR, "dist/client/env.mjs");
|
49
|
+
path$1.dirname(CLIENT_ENTRY);
|
30
50
|
|
31
51
|
const comma = ','.charCodeAt(0);
|
32
52
|
const semicolon = ';'.charCodeAt(0);
|
@@ -125,35 +145,21 @@ function getDefaultExportFromCjs (x) {
|
|
125
145
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
126
146
|
}
|
127
147
|
|
128
|
-
function commonjsRequire(path) {
|
129
|
-
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
130
|
-
}
|
131
|
-
|
132
148
|
var picocolors = {exports: {}};
|
133
149
|
|
134
|
-
let argv =
|
135
|
-
env = process.env;
|
150
|
+
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
136
151
|
let isColorSupported =
|
137
|
-
!(
|
138
|
-
(
|
139
|
-
|
140
|
-
|
141
|
-
(commonjsRequire != null && require$$0.isatty(1) && env.TERM !== "dumb") ||
|
142
|
-
"CI" in env);
|
143
|
-
|
144
|
-
let formatter =
|
145
|
-
(open, close, replace = open) =>
|
152
|
+
!(!!env.NO_COLOR || argv.includes("--no-color")) &&
|
153
|
+
(!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || ((p.stdout || {}).isTTY && env.TERM !== "dumb") || !!env.CI);
|
154
|
+
|
155
|
+
let formatter = (open, close, replace = open) =>
|
146
156
|
input => {
|
147
|
-
let string = "" + input;
|
148
|
-
|
149
|
-
return ~index
|
150
|
-
? open + replaceClose(string, close, replace, index) + close
|
151
|
-
: open + string + close
|
157
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
158
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close
|
152
159
|
};
|
153
160
|
|
154
161
|
let replaceClose = (string, close, replace, index) => {
|
155
|
-
let result = "";
|
156
|
-
let cursor = 0;
|
162
|
+
let result = "", cursor = 0;
|
157
163
|
do {
|
158
164
|
result += string.substring(cursor, index) + replace;
|
159
165
|
cursor = index + close.length;
|
@@ -163,54 +169,54 @@ let replaceClose = (string, close, replace, index) => {
|
|
163
169
|
};
|
164
170
|
|
165
171
|
let createColors = (enabled = isColorSupported) => {
|
166
|
-
let
|
172
|
+
let f = enabled ? formatter : () => String;
|
167
173
|
return {
|
168
174
|
isColorSupported: enabled,
|
169
|
-
reset:
|
170
|
-
bold:
|
171
|
-
dim:
|
172
|
-
italic:
|
173
|
-
underline:
|
174
|
-
inverse:
|
175
|
-
hidden:
|
176
|
-
strikethrough:
|
177
|
-
|
178
|
-
black:
|
179
|
-
red:
|
180
|
-
green:
|
181
|
-
yellow:
|
182
|
-
blue:
|
183
|
-
magenta:
|
184
|
-
cyan:
|
185
|
-
white:
|
186
|
-
gray:
|
187
|
-
|
188
|
-
bgBlack:
|
189
|
-
bgRed:
|
190
|
-
bgGreen:
|
191
|
-
bgYellow:
|
192
|
-
bgBlue:
|
193
|
-
bgMagenta:
|
194
|
-
bgCyan:
|
195
|
-
bgWhite:
|
196
|
-
|
197
|
-
blackBright:
|
198
|
-
redBright:
|
199
|
-
greenBright:
|
200
|
-
yellowBright:
|
201
|
-
blueBright:
|
202
|
-
magentaBright:
|
203
|
-
cyanBright:
|
204
|
-
whiteBright:
|
205
|
-
|
206
|
-
bgBlackBright:
|
207
|
-
bgRedBright:
|
208
|
-
bgGreenBright:
|
209
|
-
bgYellowBright:
|
210
|
-
bgBlueBright:
|
211
|
-
bgMagentaBright:
|
212
|
-
bgCyanBright:
|
213
|
-
bgWhiteBright:
|
175
|
+
reset: f("\x1b[0m", "\x1b[0m"),
|
176
|
+
bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
|
177
|
+
dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
|
178
|
+
italic: f("\x1b[3m", "\x1b[23m"),
|
179
|
+
underline: f("\x1b[4m", "\x1b[24m"),
|
180
|
+
inverse: f("\x1b[7m", "\x1b[27m"),
|
181
|
+
hidden: f("\x1b[8m", "\x1b[28m"),
|
182
|
+
strikethrough: f("\x1b[9m", "\x1b[29m"),
|
183
|
+
|
184
|
+
black: f("\x1b[30m", "\x1b[39m"),
|
185
|
+
red: f("\x1b[31m", "\x1b[39m"),
|
186
|
+
green: f("\x1b[32m", "\x1b[39m"),
|
187
|
+
yellow: f("\x1b[33m", "\x1b[39m"),
|
188
|
+
blue: f("\x1b[34m", "\x1b[39m"),
|
189
|
+
magenta: f("\x1b[35m", "\x1b[39m"),
|
190
|
+
cyan: f("\x1b[36m", "\x1b[39m"),
|
191
|
+
white: f("\x1b[37m", "\x1b[39m"),
|
192
|
+
gray: f("\x1b[90m", "\x1b[39m"),
|
193
|
+
|
194
|
+
bgBlack: f("\x1b[40m", "\x1b[49m"),
|
195
|
+
bgRed: f("\x1b[41m", "\x1b[49m"),
|
196
|
+
bgGreen: f("\x1b[42m", "\x1b[49m"),
|
197
|
+
bgYellow: f("\x1b[43m", "\x1b[49m"),
|
198
|
+
bgBlue: f("\x1b[44m", "\x1b[49m"),
|
199
|
+
bgMagenta: f("\x1b[45m", "\x1b[49m"),
|
200
|
+
bgCyan: f("\x1b[46m", "\x1b[49m"),
|
201
|
+
bgWhite: f("\x1b[47m", "\x1b[49m"),
|
202
|
+
|
203
|
+
blackBright: f("\x1b[90m", "\x1b[39m"),
|
204
|
+
redBright: f("\x1b[91m", "\x1b[39m"),
|
205
|
+
greenBright: f("\x1b[92m", "\x1b[39m"),
|
206
|
+
yellowBright: f("\x1b[93m", "\x1b[39m"),
|
207
|
+
blueBright: f("\x1b[94m", "\x1b[39m"),
|
208
|
+
magentaBright: f("\x1b[95m", "\x1b[39m"),
|
209
|
+
cyanBright: f("\x1b[96m", "\x1b[39m"),
|
210
|
+
whiteBright: f("\x1b[97m", "\x1b[39m"),
|
211
|
+
|
212
|
+
bgBlackBright: f("\x1b[100m", "\x1b[49m"),
|
213
|
+
bgRedBright: f("\x1b[101m", "\x1b[49m"),
|
214
|
+
bgGreenBright: f("\x1b[102m", "\x1b[49m"),
|
215
|
+
bgYellowBright: f("\x1b[103m", "\x1b[49m"),
|
216
|
+
bgBlueBright: f("\x1b[104m", "\x1b[49m"),
|
217
|
+
bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
|
218
|
+
bgCyanBright: f("\x1b[106m", "\x1b[49m"),
|
219
|
+
bgWhiteBright: f("\x1b[107m", "\x1b[49m"),
|
214
220
|
}
|
215
221
|
};
|
216
222
|
|
@@ -1247,9 +1253,8 @@ if (typeof process === 'undefined' || process.type === 'renderer' || process.bro
|
|
1247
1253
|
var srcExports = src.exports;
|
1248
1254
|
var debug$2 = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
|
1249
1255
|
|
1250
|
-
var utils$
|
1256
|
+
var utils$4 = {};
|
1251
1257
|
|
1252
|
-
const path$2 = require$$0$1;
|
1253
1258
|
const WIN_SLASH = '\\\\/';
|
1254
1259
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
1255
1260
|
|
@@ -1272,6 +1277,7 @@ const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
|
1272
1277
|
const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
1273
1278
|
const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
1274
1279
|
const STAR = `${QMARK}*?`;
|
1280
|
+
const SEP = '/';
|
1275
1281
|
|
1276
1282
|
const POSIX_CHARS = {
|
1277
1283
|
DOT_LITERAL,
|
@@ -1288,7 +1294,8 @@ const POSIX_CHARS = {
|
|
1288
1294
|
NO_DOTS_SLASH,
|
1289
1295
|
QMARK_NO_DOT,
|
1290
1296
|
STAR,
|
1291
|
-
START_ANCHOR
|
1297
|
+
START_ANCHOR,
|
1298
|
+
SEP
|
1292
1299
|
};
|
1293
1300
|
|
1294
1301
|
/**
|
@@ -1308,7 +1315,8 @@ const WINDOWS_CHARS = {
|
|
1308
1315
|
NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
1309
1316
|
QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
|
1310
1317
|
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
1311
|
-
END_ANCHOR: `(?:[${WIN_SLASH}]|$)
|
1318
|
+
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
|
1319
|
+
SEP: '\\'
|
1312
1320
|
};
|
1313
1321
|
|
1314
1322
|
/**
|
@@ -1402,8 +1410,6 @@ var constants$2 = {
|
|
1402
1410
|
CHAR_VERTICAL_LINE: 124, /* | */
|
1403
1411
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
|
1404
1412
|
|
1405
|
-
SEP: path$2.sep,
|
1406
|
-
|
1407
1413
|
/**
|
1408
1414
|
* Create EXTGLOB_CHARS
|
1409
1415
|
*/
|
@@ -1427,10 +1433,10 @@ var constants$2 = {
|
|
1427
1433
|
}
|
1428
1434
|
};
|
1429
1435
|
|
1436
|
+
/*global navigator*/
|
1437
|
+
|
1430
1438
|
(function (exports) {
|
1431
1439
|
|
1432
|
-
const path = require$$0$1;
|
1433
|
-
const win32 = process.platform === 'win32';
|
1434
1440
|
const {
|
1435
1441
|
REGEX_BACKSLASH,
|
1436
1442
|
REGEX_REMOVE_BACKSLASH,
|
@@ -1444,25 +1450,23 @@ var constants$2 = {
|
|
1444
1450
|
exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
|
1445
1451
|
exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
|
1446
1452
|
|
1447
|
-
exports.
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1453
|
+
exports.isWindows = () => {
|
1454
|
+
if (typeof navigator !== 'undefined' && navigator.platform) {
|
1455
|
+
const platform = navigator.platform.toLowerCase();
|
1456
|
+
return platform === 'win32' || platform === 'windows';
|
1457
|
+
}
|
1452
1458
|
|
1453
|
-
|
1454
|
-
|
1455
|
-
if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) {
|
1456
|
-
return true;
|
1459
|
+
if (typeof process !== 'undefined' && process.platform) {
|
1460
|
+
return process.platform === 'win32';
|
1457
1461
|
}
|
1462
|
+
|
1458
1463
|
return false;
|
1459
1464
|
};
|
1460
1465
|
|
1461
|
-
exports.
|
1462
|
-
|
1463
|
-
return
|
1464
|
-
}
|
1465
|
-
return win32 === true || path.sep === '\\';
|
1466
|
+
exports.removeBackslashes = str => {
|
1467
|
+
return str.replace(REGEX_REMOVE_BACKSLASH, match => {
|
1468
|
+
return match === '\\' ? '' : match;
|
1469
|
+
});
|
1466
1470
|
};
|
1467
1471
|
|
1468
1472
|
exports.escapeLast = (input, char, lastIdx) => {
|
@@ -1490,10 +1494,21 @@ var constants$2 = {
|
|
1490
1494
|
output = `(?:^(?!${output}).*$)`;
|
1491
1495
|
}
|
1492
1496
|
return output;
|
1497
|
+
};
|
1498
|
+
|
1499
|
+
exports.basename = (path, { windows } = {}) => {
|
1500
|
+
const segs = path.split(windows ? /[\\/]/ : '/');
|
1501
|
+
const last = segs[segs.length - 1];
|
1502
|
+
|
1503
|
+
if (last === '') {
|
1504
|
+
return segs[segs.length - 2];
|
1505
|
+
}
|
1506
|
+
|
1507
|
+
return last;
|
1493
1508
|
};
|
1494
|
-
} (utils$
|
1509
|
+
} (utils$4));
|
1495
1510
|
|
1496
|
-
const utils$
|
1511
|
+
const utils$3 = utils$4;
|
1497
1512
|
const {
|
1498
1513
|
CHAR_ASTERISK, /* * */
|
1499
1514
|
CHAR_AT, /* @ */
|
@@ -1810,10 +1825,10 @@ const scan$1 = (input, options) => {
|
|
1810
1825
|
}
|
1811
1826
|
|
1812
1827
|
if (opts.unescape === true) {
|
1813
|
-
if (glob) glob = utils$
|
1828
|
+
if (glob) glob = utils$3.removeBackslashes(glob);
|
1814
1829
|
|
1815
1830
|
if (base && backslashes === true) {
|
1816
|
-
base = utils$
|
1831
|
+
base = utils$3.removeBackslashes(base);
|
1817
1832
|
}
|
1818
1833
|
}
|
1819
1834
|
|
@@ -1884,7 +1899,7 @@ const scan$1 = (input, options) => {
|
|
1884
1899
|
var scan_1 = scan$1;
|
1885
1900
|
|
1886
1901
|
const constants$1 = constants$2;
|
1887
|
-
const utils$
|
1902
|
+
const utils$2 = utils$4;
|
1888
1903
|
|
1889
1904
|
/**
|
1890
1905
|
* Constants
|
@@ -1947,10 +1962,9 @@ const parse$2 = (input, options) => {
|
|
1947
1962
|
const tokens = [bos];
|
1948
1963
|
|
1949
1964
|
const capture = opts.capture ? '' : '?:';
|
1950
|
-
const win32 = utils$1.isWindows(options);
|
1951
1965
|
|
1952
1966
|
// create constants based on platform, for windows or posix
|
1953
|
-
const PLATFORM_CHARS = constants$1.globChars(
|
1967
|
+
const PLATFORM_CHARS = constants$1.globChars(opts.windows);
|
1954
1968
|
const EXTGLOB_CHARS = constants$1.extglobChars(PLATFORM_CHARS);
|
1955
1969
|
|
1956
1970
|
const {
|
@@ -2003,7 +2017,7 @@ const parse$2 = (input, options) => {
|
|
2003
2017
|
tokens
|
2004
2018
|
};
|
2005
2019
|
|
2006
|
-
input = utils$
|
2020
|
+
input = utils$2.removePrefix(input, state);
|
2007
2021
|
len = input.length;
|
2008
2022
|
|
2009
2023
|
const extglobs = [];
|
@@ -2086,8 +2100,8 @@ const parse$2 = (input, options) => {
|
|
2086
2100
|
|
2087
2101
|
if (tok.value || tok.output) append(tok);
|
2088
2102
|
if (prev && prev.type === 'text' && tok.type === 'text') {
|
2103
|
+
prev.output = (prev.output || prev.value) + tok.value;
|
2089
2104
|
prev.value += tok.value;
|
2090
|
-
prev.output = (prev.output || '') + tok.value;
|
2091
2105
|
return;
|
2092
2106
|
}
|
2093
2107
|
|
@@ -2196,7 +2210,7 @@ const parse$2 = (input, options) => {
|
|
2196
2210
|
return state;
|
2197
2211
|
}
|
2198
2212
|
|
2199
|
-
state.output = utils$
|
2213
|
+
state.output = utils$2.wrapOutput(output, state, options);
|
2200
2214
|
return state;
|
2201
2215
|
}
|
2202
2216
|
|
@@ -2309,7 +2323,7 @@ const parse$2 = (input, options) => {
|
|
2309
2323
|
*/
|
2310
2324
|
|
2311
2325
|
if (state.quotes === 1 && value !== '"') {
|
2312
|
-
value = utils$
|
2326
|
+
value = utils$2.escapeRegex(value);
|
2313
2327
|
prev.value += value;
|
2314
2328
|
append({ value });
|
2315
2329
|
continue;
|
@@ -2399,11 +2413,11 @@ const parse$2 = (input, options) => {
|
|
2399
2413
|
|
2400
2414
|
// when literal brackets are explicitly disabled
|
2401
2415
|
// assume we should match with a regex character class
|
2402
|
-
if (opts.literalBrackets === false || utils$
|
2416
|
+
if (opts.literalBrackets === false || utils$2.hasRegexChars(prevValue)) {
|
2403
2417
|
continue;
|
2404
2418
|
}
|
2405
2419
|
|
2406
|
-
const escaped = utils$
|
2420
|
+
const escaped = utils$2.escapeRegex(prev.value);
|
2407
2421
|
state.output = state.output.slice(0, -prev.value.length);
|
2408
2422
|
|
2409
2423
|
// when literal brackets are explicitly enabled
|
@@ -2575,10 +2589,6 @@ const parse$2 = (input, options) => {
|
|
2575
2589
|
const next = peek();
|
2576
2590
|
let output = value;
|
2577
2591
|
|
2578
|
-
if (next === '<' && !utils$1.supportsLookbehinds()) {
|
2579
|
-
throw new Error('Node.js v10 or higher is required for regex lookbehinds');
|
2580
|
-
}
|
2581
|
-
|
2582
2592
|
if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
|
2583
2593
|
output = `\\${value}`;
|
2584
2594
|
}
|
@@ -2835,19 +2845,19 @@ const parse$2 = (input, options) => {
|
|
2835
2845
|
|
2836
2846
|
while (state.brackets > 0) {
|
2837
2847
|
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
|
2838
|
-
state.output = utils$
|
2848
|
+
state.output = utils$2.escapeLast(state.output, '[');
|
2839
2849
|
decrement('brackets');
|
2840
2850
|
}
|
2841
2851
|
|
2842
2852
|
while (state.parens > 0) {
|
2843
2853
|
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
|
2844
|
-
state.output = utils$
|
2854
|
+
state.output = utils$2.escapeLast(state.output, '(');
|
2845
2855
|
decrement('parens');
|
2846
2856
|
}
|
2847
2857
|
|
2848
2858
|
while (state.braces > 0) {
|
2849
2859
|
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
|
2850
|
-
state.output = utils$
|
2860
|
+
state.output = utils$2.escapeLast(state.output, '{');
|
2851
2861
|
decrement('braces');
|
2852
2862
|
}
|
2853
2863
|
|
@@ -2886,7 +2896,6 @@ parse$2.fastpaths = (input, options) => {
|
|
2886
2896
|
}
|
2887
2897
|
|
2888
2898
|
input = REPLACEMENTS[input] || input;
|
2889
|
-
const win32 = utils$1.isWindows(options);
|
2890
2899
|
|
2891
2900
|
// create constants based on platform, for windows or posix
|
2892
2901
|
const {
|
@@ -2899,7 +2908,7 @@ parse$2.fastpaths = (input, options) => {
|
|
2899
2908
|
NO_DOTS_SLASH,
|
2900
2909
|
STAR,
|
2901
2910
|
START_ANCHOR
|
2902
|
-
} = constants$1.globChars(
|
2911
|
+
} = constants$1.globChars(opts.windows);
|
2903
2912
|
|
2904
2913
|
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
2905
2914
|
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
@@ -2954,7 +2963,7 @@ parse$2.fastpaths = (input, options) => {
|
|
2954
2963
|
}
|
2955
2964
|
};
|
2956
2965
|
|
2957
|
-
const output = utils$
|
2966
|
+
const output = utils$2.removePrefix(input, state);
|
2958
2967
|
let source = create(output);
|
2959
2968
|
|
2960
2969
|
if (source && opts.strictSlashes !== true) {
|
@@ -2966,10 +2975,9 @@ parse$2.fastpaths = (input, options) => {
|
|
2966
2975
|
|
2967
2976
|
var parse_1$1 = parse$2;
|
2968
2977
|
|
2969
|
-
const path$1 = require$$0$1;
|
2970
2978
|
const scan = scan_1;
|
2971
2979
|
const parse$1 = parse_1$1;
|
2972
|
-
const utils = utils$
|
2980
|
+
const utils$1 = utils$4;
|
2973
2981
|
const constants = constants$2;
|
2974
2982
|
const isObject$2 = val => val && typeof val === 'object' && !Array.isArray(val);
|
2975
2983
|
|
@@ -3015,7 +3023,7 @@ const picomatch$1 = (glob, options, returnState = false) => {
|
|
3015
3023
|
}
|
3016
3024
|
|
3017
3025
|
const opts = options || {};
|
3018
|
-
const posix =
|
3026
|
+
const posix = opts.windows;
|
3019
3027
|
const regex = isState
|
3020
3028
|
? picomatch$1.compileRe(glob, options)
|
3021
3029
|
: picomatch$1.makeRe(glob, options, false, true);
|
@@ -3090,7 +3098,7 @@ picomatch$1.test = (input, regex, options, { glob, posix } = {}) => {
|
|
3090
3098
|
}
|
3091
3099
|
|
3092
3100
|
const opts = options || {};
|
3093
|
-
const format = opts.format || (posix ? utils.toPosixSlashes : null);
|
3101
|
+
const format = opts.format || (posix ? utils$1.toPosixSlashes : null);
|
3094
3102
|
let match = input === glob;
|
3095
3103
|
let output = (match && format) ? format(input) : input;
|
3096
3104
|
|
@@ -3124,9 +3132,9 @@ picomatch$1.test = (input, regex, options, { glob, posix } = {}) => {
|
|
3124
3132
|
* @api public
|
3125
3133
|
*/
|
3126
3134
|
|
3127
|
-
picomatch$1.matchBase = (input, glob, options
|
3135
|
+
picomatch$1.matchBase = (input, glob, options) => {
|
3128
3136
|
const regex = glob instanceof RegExp ? glob : picomatch$1.makeRe(glob, options);
|
3129
|
-
return regex.test(
|
3137
|
+
return regex.test(utils$1.basename(input));
|
3130
3138
|
};
|
3131
3139
|
|
3132
3140
|
/**
|
@@ -3305,11 +3313,25 @@ picomatch$1.constants = constants;
|
|
3305
3313
|
* Expose "picomatch"
|
3306
3314
|
*/
|
3307
3315
|
|
3308
|
-
var picomatch_1 = picomatch$1;
|
3316
|
+
var picomatch_1$1 = picomatch$1;
|
3317
|
+
|
3318
|
+
const pico = picomatch_1$1;
|
3319
|
+
const utils = utils$4;
|
3320
|
+
|
3321
|
+
function picomatch(glob, options, returnState = false) {
|
3322
|
+
// default to os.platform()
|
3323
|
+
if (options && (options.windows === null || options.windows === undefined)) {
|
3324
|
+
// don't mutate the original options object
|
3325
|
+
options = { ...options, windows: utils.isWindows() };
|
3326
|
+
}
|
3327
|
+
|
3328
|
+
return pico(glob, options, returnState);
|
3329
|
+
}
|
3309
3330
|
|
3310
|
-
|
3331
|
+
Object.assign(picomatch, pico);
|
3332
|
+
var picomatch_1 = picomatch;
|
3311
3333
|
|
3312
|
-
var pm = /*@__PURE__*/getDefaultExportFromCjs(
|
3334
|
+
var pm = /*@__PURE__*/getDefaultExportFromCjs(picomatch_1);
|
3313
3335
|
|
3314
3336
|
// Helper since Typescript can't detect readonly arrays with Array.isArray
|
3315
3337
|
function isArray(arg) {
|
@@ -3323,23 +3345,24 @@ function ensureArray(thing) {
|
|
3323
3345
|
return [thing];
|
3324
3346
|
}
|
3325
3347
|
|
3348
|
+
const normalizePathRegExp = new RegExp(`\\${require$$1$1.win32.sep}`, 'g');
|
3326
3349
|
const normalizePath$1 = function normalizePath(filename) {
|
3327
|
-
return filename.
|
3350
|
+
return filename.replace(normalizePathRegExp, require$$1$1.posix.sep);
|
3328
3351
|
};
|
3329
3352
|
|
3330
3353
|
function getMatcherString(id, resolutionBase) {
|
3331
|
-
if (resolutionBase === false || require$$
|
3354
|
+
if (resolutionBase === false || require$$1$1.isAbsolute(id) || id.startsWith('**')) {
|
3332
3355
|
return normalizePath$1(id);
|
3333
3356
|
}
|
3334
3357
|
// resolve('') is valid and will default to process.cwd()
|
3335
|
-
const basePath = normalizePath$1(require$$
|
3358
|
+
const basePath = normalizePath$1(require$$1$1.resolve(resolutionBase || ''))
|
3336
3359
|
// escape all possible (posix + win) path characters that might interfere with regex
|
3337
3360
|
.replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
|
3338
3361
|
// Note that we use posix.join because:
|
3339
3362
|
// 1. the basePath has been normalized to use /
|
3340
3363
|
// 2. the incoming glob (id) matcher, also uses /
|
3341
3364
|
// otherwise Node will force backslash (\) on windows
|
3342
|
-
return require$$
|
3365
|
+
return require$$1$1.posix.join(basePath, normalizePath$1(id));
|
3343
3366
|
}
|
3344
3367
|
const createFilter$1 = function createFilter(include, exclude, options) {
|
3345
3368
|
const resolutionBase = options && options.resolve;
|
@@ -3356,10 +3379,12 @@ const createFilter$1 = function createFilter(include, exclude, options) {
|
|
3356
3379
|
};
|
3357
3380
|
const includeMatchers = ensureArray(include).map(getMatcher);
|
3358
3381
|
const excludeMatchers = ensureArray(exclude).map(getMatcher);
|
3382
|
+
if (!includeMatchers.length && !excludeMatchers.length)
|
3383
|
+
return (id) => typeof id === 'string' && !id.includes('\0');
|
3359
3384
|
return function result(id) {
|
3360
3385
|
if (typeof id !== 'string')
|
3361
3386
|
return false;
|
3362
|
-
if (
|
3387
|
+
if (id.includes('\0'))
|
3363
3388
|
return false;
|
3364
3389
|
const pathId = normalizePath$1(id);
|
3365
3390
|
for (let i = 0; i < excludeMatchers.length; ++i) {
|
@@ -3397,29 +3422,106 @@ function withTrailingSlash(path) {
|
|
3397
3422
|
return path;
|
3398
3423
|
}
|
3399
3424
|
|
3425
|
+
let pnp;
|
3400
3426
|
if (process.versions.pnp) {
|
3401
3427
|
try {
|
3402
|
-
node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href)))("pnpapi");
|
3428
|
+
pnp = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href)))("pnpapi");
|
3403
3429
|
} catch {
|
3404
3430
|
}
|
3405
3431
|
}
|
3432
|
+
function resolvePackageData(pkgName, basedir, preserveSymlinks = false, packageCache) {
|
3433
|
+
if (pnp) {
|
3434
|
+
try {
|
3435
|
+
const pkg = pnp.resolveToUnqualified(pkgName, basedir, {
|
3436
|
+
considerBuiltins: false
|
3437
|
+
});
|
3438
|
+
if (!pkg) return null;
|
3439
|
+
const pkgData = loadPackageData(path$1.join(pkg, "package.json"));
|
3440
|
+
return pkgData;
|
3441
|
+
} catch {
|
3442
|
+
return null;
|
3443
|
+
}
|
3444
|
+
}
|
3445
|
+
while (basedir) {
|
3446
|
+
const pkg = path$1.join(basedir, "node_modules", pkgName, "package.json");
|
3447
|
+
try {
|
3448
|
+
if (fs$1.existsSync(pkg)) {
|
3449
|
+
const pkgPath = preserveSymlinks ? pkg : safeRealpathSync(pkg);
|
3450
|
+
const pkgData = loadPackageData(pkgPath);
|
3451
|
+
return pkgData;
|
3452
|
+
}
|
3453
|
+
} catch {
|
3454
|
+
}
|
3455
|
+
const nextBasedir = path$1.dirname(basedir);
|
3456
|
+
if (nextBasedir === basedir) break;
|
3457
|
+
basedir = nextBasedir;
|
3458
|
+
}
|
3459
|
+
return null;
|
3460
|
+
}
|
3461
|
+
function loadPackageData(pkgPath) {
|
3462
|
+
const data = JSON.parse(fs$1.readFileSync(pkgPath, "utf-8"));
|
3463
|
+
const pkgDir = normalizePath(path$1.dirname(pkgPath));
|
3464
|
+
const { sideEffects } = data;
|
3465
|
+
let hasSideEffects;
|
3466
|
+
if (typeof sideEffects === "boolean") {
|
3467
|
+
hasSideEffects = () => sideEffects;
|
3468
|
+
} else if (Array.isArray(sideEffects)) {
|
3469
|
+
if (sideEffects.length <= 0) {
|
3470
|
+
hasSideEffects = () => false;
|
3471
|
+
} else {
|
3472
|
+
const finalPackageSideEffects = sideEffects.map((sideEffect) => {
|
3473
|
+
if (sideEffect.includes("/")) {
|
3474
|
+
return sideEffect;
|
3475
|
+
}
|
3476
|
+
return `**/${sideEffect}`;
|
3477
|
+
});
|
3478
|
+
hasSideEffects = createFilter(finalPackageSideEffects, null, {
|
3479
|
+
resolve: pkgDir
|
3480
|
+
});
|
3481
|
+
}
|
3482
|
+
} else {
|
3483
|
+
hasSideEffects = () => null;
|
3484
|
+
}
|
3485
|
+
const resolvedCache = {};
|
3486
|
+
const pkg = {
|
3487
|
+
dir: pkgDir,
|
3488
|
+
data,
|
3489
|
+
hasSideEffects,
|
3490
|
+
setResolvedCache(key, entry, options) {
|
3491
|
+
resolvedCache[getResolveCacheKey(key, options)] = entry;
|
3492
|
+
},
|
3493
|
+
getResolvedCache(key, options) {
|
3494
|
+
return resolvedCache[getResolveCacheKey(key, options)];
|
3495
|
+
}
|
3496
|
+
};
|
3497
|
+
return pkg;
|
3498
|
+
}
|
3499
|
+
function getResolveCacheKey(key, options) {
|
3500
|
+
return [
|
3501
|
+
key,
|
3502
|
+
options.isRequire ? "1" : "0",
|
3503
|
+
options.conditions.join("_"),
|
3504
|
+
options.extensions.join("_"),
|
3505
|
+
options.mainFields.join("_")
|
3506
|
+
].join("|");
|
3507
|
+
}
|
3406
3508
|
|
3407
3509
|
const createFilter = createFilter$1;
|
3408
3510
|
node_module.builtinModules.filter((id) => !id.includes(":"));
|
3409
3511
|
function isInNodeModules(id) {
|
3410
3512
|
return id.includes("node_modules");
|
3411
3513
|
}
|
3412
|
-
|
3413
|
-
|
3414
|
-
|
3415
|
-
return JSON.parse(fs$1.readFileSync(pkgPath, "utf-8")).version;
|
3416
|
-
}
|
3417
|
-
const rollupVersion = resolveDependencyVersion("rollup");
|
3514
|
+
node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href)));
|
3515
|
+
const _dirname = path$1.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href))));
|
3516
|
+
const rollupVersion = resolvePackageData("rollup", _dirname, true)?.data.version ?? "";
|
3418
3517
|
const filter = process.env.VITE_DEBUG_FILTER;
|
3419
3518
|
const DEBUG = process.env.DEBUG;
|
3420
3519
|
function createDebugger(namespace, options = {}) {
|
3421
3520
|
const log = debug$2(namespace);
|
3422
|
-
const { onlyWhenFocused } = options;
|
3521
|
+
const { onlyWhenFocused, depth } = options;
|
3522
|
+
if (depth && log.inspectOpts && log.inspectOpts.depth == null) {
|
3523
|
+
log.inspectOpts.depth = options.depth;
|
3524
|
+
}
|
3423
3525
|
let enabled = log.enabled;
|
3424
3526
|
if (enabled && onlyWhenFocused) {
|
3425
3527
|
const ns = typeof onlyWhenFocused === "string" ? onlyWhenFocused : namespace;
|
@@ -3449,7 +3551,7 @@ function testCaseInsensitiveFS() {
|
|
3449
3551
|
const isCaseInsensitiveFS = testCaseInsensitiveFS();
|
3450
3552
|
const VOLUME_RE = /^[A-Z]:/i;
|
3451
3553
|
function normalizePath(id) {
|
3452
|
-
return path$
|
3554
|
+
return path$1.posix.normalize(isWindows ? slash(id) : id);
|
3453
3555
|
}
|
3454
3556
|
function fsPathFromId(id) {
|
3455
3557
|
const fsPath = normalizePath(
|
@@ -3492,10 +3594,57 @@ function isFileReadable(filename) {
|
|
3492
3594
|
return false;
|
3493
3595
|
}
|
3494
3596
|
}
|
3597
|
+
let safeRealpathSync = isWindows ? windowsSafeRealPathSync : fs$1.realpathSync.native;
|
3598
|
+
const windowsNetworkMap = /* @__PURE__ */ new Map();
|
3599
|
+
function windowsMappedRealpathSync(path2) {
|
3600
|
+
const realPath = fs$1.realpathSync.native(path2);
|
3601
|
+
if (realPath.startsWith("\\\\")) {
|
3602
|
+
for (const [network, volume] of windowsNetworkMap) {
|
3603
|
+
if (realPath.startsWith(network)) return realPath.replace(network, volume);
|
3604
|
+
}
|
3605
|
+
}
|
3606
|
+
return realPath;
|
3607
|
+
}
|
3608
|
+
const parseNetUseRE = /^\w* +(\w:) +([^ ]+)\s/;
|
3609
|
+
let firstSafeRealPathSyncRun = false;
|
3610
|
+
function windowsSafeRealPathSync(path2) {
|
3611
|
+
if (!firstSafeRealPathSyncRun) {
|
3612
|
+
optimizeSafeRealPathSync();
|
3613
|
+
firstSafeRealPathSyncRun = true;
|
3614
|
+
}
|
3615
|
+
return fs$1.realpathSync(path2);
|
3616
|
+
}
|
3617
|
+
function optimizeSafeRealPathSync() {
|
3618
|
+
const nodeVersion = process.versions.node.split(".").map(Number);
|
3619
|
+
if (nodeVersion[0] < 18 || nodeVersion[0] === 18 && nodeVersion[1] < 10) {
|
3620
|
+
safeRealpathSync = fs$1.realpathSync;
|
3621
|
+
return;
|
3622
|
+
}
|
3623
|
+
try {
|
3624
|
+
fs$1.realpathSync.native(path$1.resolve("./"));
|
3625
|
+
} catch (error) {
|
3626
|
+
if (error.message.includes("EISDIR: illegal operation on a directory")) {
|
3627
|
+
safeRealpathSync = fs$1.realpathSync;
|
3628
|
+
return;
|
3629
|
+
}
|
3630
|
+
}
|
3631
|
+
node_child_process.exec("net use", (error, stdout) => {
|
3632
|
+
if (error) return;
|
3633
|
+
const lines = stdout.split("\n");
|
3634
|
+
for (const line of lines) {
|
3635
|
+
const m = parseNetUseRE.exec(line);
|
3636
|
+
if (m) windowsNetworkMap.set(m[2], m[1]);
|
3637
|
+
}
|
3638
|
+
if (windowsNetworkMap.size === 0) {
|
3639
|
+
safeRealpathSync = fs$1.realpathSync.native;
|
3640
|
+
} else {
|
3641
|
+
safeRealpathSync = windowsMappedRealpathSync;
|
3642
|
+
}
|
3643
|
+
});
|
3644
|
+
}
|
3495
3645
|
function arraify(target) {
|
3496
3646
|
return Array.isArray(target) ? target : [target];
|
3497
3647
|
}
|
3498
|
-
path$3.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href))));
|
3499
3648
|
function backwardCompatibleWorkerPlugins(plugins) {
|
3500
3649
|
if (Array.isArray(plugins)) {
|
3501
3650
|
return plugins;
|
@@ -3697,6 +3846,26 @@ function splitVendorChunkPlugin() {
|
|
3697
3846
|
};
|
3698
3847
|
}
|
3699
3848
|
|
3849
|
+
function perEnvironmentPlugin(name, applyToEnvironment) {
|
3850
|
+
return {
|
3851
|
+
name,
|
3852
|
+
applyToEnvironment
|
3853
|
+
};
|
3854
|
+
}
|
3855
|
+
|
3856
|
+
function perEnvironmentState(initial) {
|
3857
|
+
const stateMap = /* @__PURE__ */ new WeakMap();
|
3858
|
+
return function(context) {
|
3859
|
+
const { environment } = context;
|
3860
|
+
let state = stateMap.get(environment);
|
3861
|
+
if (!state) {
|
3862
|
+
state = initial(environment);
|
3863
|
+
stateMap.set(environment, state);
|
3864
|
+
}
|
3865
|
+
return state;
|
3866
|
+
};
|
3867
|
+
}
|
3868
|
+
|
3700
3869
|
var convertSourceMap$1 = {};
|
3701
3870
|
|
3702
3871
|
(function (exports) {
|
@@ -3954,8 +4123,8 @@ var etag_1 = etag;
|
|
3954
4123
|
* @private
|
3955
4124
|
*/
|
3956
4125
|
|
3957
|
-
var crypto$1 = require$$0$
|
3958
|
-
var Stats =
|
4126
|
+
var crypto$1 = require$$0$1;
|
4127
|
+
var Stats = require$$1$2.Stats;
|
3959
4128
|
|
3960
4129
|
/**
|
3961
4130
|
* Module variables.
|
@@ -4430,27 +4599,6 @@ class Mappings {
|
|
4430
4599
|
let charInHiresBoundary = false;
|
4431
4600
|
|
4432
4601
|
while (originalCharIndex < chunk.end) {
|
4433
|
-
if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
|
4434
|
-
const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
4435
|
-
|
4436
|
-
if (this.hires === 'boundary') {
|
4437
|
-
// in hires "boundary", group segments per word boundary than per char
|
4438
|
-
if (wordRegex.test(original[originalCharIndex])) {
|
4439
|
-
// for first char in the boundary found, start the boundary by pushing a segment
|
4440
|
-
if (!charInHiresBoundary) {
|
4441
|
-
this.rawSegments.push(segment);
|
4442
|
-
charInHiresBoundary = true;
|
4443
|
-
}
|
4444
|
-
} else {
|
4445
|
-
// for non-word char, end the boundary by pushing a segment
|
4446
|
-
this.rawSegments.push(segment);
|
4447
|
-
charInHiresBoundary = false;
|
4448
|
-
}
|
4449
|
-
} else {
|
4450
|
-
this.rawSegments.push(segment);
|
4451
|
-
}
|
4452
|
-
}
|
4453
|
-
|
4454
4602
|
if (original[originalCharIndex] === '\n') {
|
4455
4603
|
loc.line += 1;
|
4456
4604
|
loc.column = 0;
|
@@ -4459,6 +4607,27 @@ class Mappings {
|
|
4459
4607
|
this.generatedCodeColumn = 0;
|
4460
4608
|
first = true;
|
4461
4609
|
} else {
|
4610
|
+
if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
|
4611
|
+
const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
4612
|
+
|
4613
|
+
if (this.hires === 'boundary') {
|
4614
|
+
// in hires "boundary", group segments per word boundary than per char
|
4615
|
+
if (wordRegex.test(original[originalCharIndex])) {
|
4616
|
+
// for first char in the boundary found, start the boundary by pushing a segment
|
4617
|
+
if (!charInHiresBoundary) {
|
4618
|
+
this.rawSegments.push(segment);
|
4619
|
+
charInHiresBoundary = true;
|
4620
|
+
}
|
4621
|
+
} else {
|
4622
|
+
// for non-word char, end the boundary by pushing a segment
|
4623
|
+
this.rawSegments.push(segment);
|
4624
|
+
charInHiresBoundary = false;
|
4625
|
+
}
|
4626
|
+
} else {
|
4627
|
+
this.rawSegments.push(segment);
|
4628
|
+
}
|
4629
|
+
}
|
4630
|
+
|
4462
4631
|
loc.column += 1;
|
4463
4632
|
this.generatedCodeColumn += 1;
|
4464
4633
|
first = false;
|
@@ -5394,7 +5563,7 @@ function send(req, res, content, type, options) {
|
|
5394
5563
|
type,
|
5395
5564
|
code,
|
5396
5565
|
ms.generateMap({
|
5397
|
-
source: path$
|
5566
|
+
source: path$1.basename(urlWithoutTimestamp),
|
5398
5567
|
hires: "boundary",
|
5399
5568
|
includeContent: true
|
5400
5569
|
})
|
@@ -5436,7 +5605,11 @@ function createLogger(level = "info", options = {}) {
|
|
5436
5605
|
return options.customLogger;
|
5437
5606
|
}
|
5438
5607
|
const loggedErrors = /* @__PURE__ */ new WeakSet();
|
5439
|
-
const {
|
5608
|
+
const {
|
5609
|
+
prefix = "[vite]",
|
5610
|
+
allowClearScreen = true,
|
5611
|
+
console: console2 = globalThis.console
|
5612
|
+
} = options;
|
5440
5613
|
const thresh = LogLevels[level];
|
5441
5614
|
const canClearScreen = allowClearScreen && process.stdout.isTTY && !process.env.CI;
|
5442
5615
|
const clear = canClearScreen ? clearScreen : () => {
|
@@ -5467,7 +5640,7 @@ function createLogger(level = "info", options = {}) {
|
|
5467
5640
|
if (type === lastType && msg === lastMsg) {
|
5468
5641
|
sameCount++;
|
5469
5642
|
clear();
|
5470
|
-
|
5643
|
+
console2[method](
|
5471
5644
|
format(type, msg, options2),
|
5472
5645
|
colors.yellow(`(x${sameCount + 1})`)
|
5473
5646
|
);
|
@@ -5478,10 +5651,10 @@ function createLogger(level = "info", options = {}) {
|
|
5478
5651
|
if (options2.clear) {
|
5479
5652
|
clear();
|
5480
5653
|
}
|
5481
|
-
|
5654
|
+
console2[method](format(type, msg, options2));
|
5482
5655
|
}
|
5483
5656
|
} else {
|
5484
|
-
|
5657
|
+
console2[method](format(type, msg, options2));
|
5485
5658
|
}
|
5486
5659
|
}
|
5487
5660
|
}
|
@@ -5530,7 +5703,7 @@ const ROOT_FILES = [
|
|
5530
5703
|
"lerna.json"
|
5531
5704
|
];
|
5532
5705
|
function hasWorkspacePackageJSON(root) {
|
5533
|
-
const path = path$
|
5706
|
+
const path = path$1.join(root, "package.json");
|
5534
5707
|
if (!isFileReadable(path)) {
|
5535
5708
|
return false;
|
5536
5709
|
}
|
@@ -5542,22 +5715,22 @@ function hasWorkspacePackageJSON(root) {
|
|
5542
5715
|
}
|
5543
5716
|
}
|
5544
5717
|
function hasRootFile(root) {
|
5545
|
-
return ROOT_FILES.some((file) => fs$1.existsSync(path$
|
5718
|
+
return ROOT_FILES.some((file) => fs$1.existsSync(path$1.join(root, file)));
|
5546
5719
|
}
|
5547
5720
|
function hasPackageJSON(root) {
|
5548
|
-
const path = path$
|
5721
|
+
const path = path$1.join(root, "package.json");
|
5549
5722
|
return fs$1.existsSync(path);
|
5550
5723
|
}
|
5551
5724
|
function searchForPackageRoot(current, root = current) {
|
5552
5725
|
if (hasPackageJSON(current)) return current;
|
5553
|
-
const dir = path$
|
5726
|
+
const dir = path$1.dirname(current);
|
5554
5727
|
if (!dir || dir === current) return root;
|
5555
5728
|
return searchForPackageRoot(dir, root);
|
5556
5729
|
}
|
5557
5730
|
function searchForWorkspaceRoot(current, root = searchForPackageRoot(current)) {
|
5558
5731
|
if (hasRootFile(current)) return current;
|
5559
5732
|
if (hasWorkspacePackageJSON(current)) return current;
|
5560
|
-
const dir = path$
|
5733
|
+
const dir = path$1.dirname(current);
|
5561
5734
|
if (!dir || dir === current) return root;
|
5562
5735
|
return searchForWorkspaceRoot(dir, root);
|
5563
5736
|
}
|
@@ -5664,10 +5837,10 @@ var require$$4 = {
|
|
5664
5837
|
browser: browser
|
5665
5838
|
};
|
5666
5839
|
|
5667
|
-
const fs =
|
5668
|
-
const path = require$$
|
5840
|
+
const fs = require$$1$2;
|
5841
|
+
const path = require$$1$1;
|
5669
5842
|
const os = require$$2;
|
5670
|
-
const crypto = require$$0$
|
5843
|
+
const crypto = require$$0$1;
|
5671
5844
|
const packageJson = require$$4;
|
5672
5845
|
|
5673
5846
|
const version = packageJson.version;
|
@@ -6123,7 +6296,7 @@ function getEnvFilesForMode(mode, envDir) {
|
|
6123
6296
|
`.env.${mode}`,
|
6124
6297
|
/** mode local file */
|
6125
6298
|
`.env.${mode}.local`
|
6126
|
-
].map((file) => normalizePath(path$
|
6299
|
+
].map((file) => normalizePath(path$1.join(envDir, file)));
|
6127
6300
|
}
|
6128
6301
|
function loadEnv(mode, envDir, prefixes = "VITE_") {
|
6129
6302
|
if (mode === "local") {
|
@@ -6178,6 +6351,10 @@ function resolveEnvPrefix({
|
|
6178
6351
|
exports.esbuildVersion = esbuild.version;
|
6179
6352
|
exports.createFilter = createFilter;
|
6180
6353
|
exports.createLogger = createLogger;
|
6354
|
+
exports.defaultClientConditions = DEFAULT_CLIENT_CONDITIONS;
|
6355
|
+
exports.defaultClientMainFields = DEFAULT_CLIENT_MAIN_FIELDS;
|
6356
|
+
exports.defaultServerConditions = DEFAULT_SERVER_CONDITIONS;
|
6357
|
+
exports.defaultServerMainFields = DEFAULT_SERVER_MAIN_FIELDS;
|
6181
6358
|
exports.isCSSRequest = isCSSRequest;
|
6182
6359
|
exports.isFileLoadingAllowed = isFileLoadingAllowed;
|
6183
6360
|
exports.isFileServingAllowed = isFileServingAllowed;
|
@@ -6185,6 +6362,8 @@ exports.loadEnv = loadEnv;
|
|
6185
6362
|
exports.mergeAlias = mergeAlias;
|
6186
6363
|
exports.mergeConfig = mergeConfig;
|
6187
6364
|
exports.normalizePath = normalizePath;
|
6365
|
+
exports.perEnvironmentPlugin = perEnvironmentPlugin;
|
6366
|
+
exports.perEnvironmentState = perEnvironmentState;
|
6188
6367
|
exports.resolveEnvPrefix = resolveEnvPrefix;
|
6189
6368
|
exports.rollupVersion = rollupVersion;
|
6190
6369
|
exports.searchForWorkspaceRoot = searchForWorkspaceRoot;
|