vite 4.4.1 → 4.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of vite might be problematic. Click here for more details.
- package/dist/node/chunks/{dep-198ec93b.js → dep-0ba93c62.js} +1 -1
- package/dist/node/chunks/{dep-439026c8.js → dep-210e5610.js} +175 -155
- package/dist/node/chunks/{dep-b3c79893.js → dep-9ccfaa3e.js} +1 -1
- package/dist/node/cli.js +5 -5
- package/dist/node/index.js +2 -2
- package/dist/node-cjs/publicUtils.cjs +16 -7
- package/package.json +6 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as commonjsGlobal, E as getDefaultExportFromCjs } from './dep-
|
|
1
|
+
import { F as commonjsGlobal, E as getDefaultExportFromCjs } from './dep-210e5610.js';
|
|
2
2
|
import require$$0__default from 'fs';
|
|
3
3
|
import require$$0 from 'postcss';
|
|
4
4
|
import require$$0$1 from 'path';
|
|
@@ -10189,6 +10189,94 @@ class SetArray {
|
|
|
10189
10189
|
};
|
|
10190
10190
|
})();
|
|
10191
10191
|
|
|
10192
|
+
const comma = ','.charCodeAt(0);
|
|
10193
|
+
const semicolon = ';'.charCodeAt(0);
|
|
10194
|
+
const chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
10195
|
+
const intToChar = new Uint8Array(64); // 64 possible chars.
|
|
10196
|
+
const charToInt = new Uint8Array(128); // z is 122 in ASCII
|
|
10197
|
+
for (let i = 0; i < chars$1.length; i++) {
|
|
10198
|
+
const c = chars$1.charCodeAt(i);
|
|
10199
|
+
intToChar[i] = c;
|
|
10200
|
+
charToInt[c] = i;
|
|
10201
|
+
}
|
|
10202
|
+
// Provide a fallback for older environments.
|
|
10203
|
+
const td = typeof TextDecoder !== 'undefined'
|
|
10204
|
+
? /* #__PURE__ */ new TextDecoder()
|
|
10205
|
+
: typeof Buffer !== 'undefined'
|
|
10206
|
+
? {
|
|
10207
|
+
decode(buf) {
|
|
10208
|
+
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
10209
|
+
return out.toString();
|
|
10210
|
+
},
|
|
10211
|
+
}
|
|
10212
|
+
: {
|
|
10213
|
+
decode(buf) {
|
|
10214
|
+
let out = '';
|
|
10215
|
+
for (let i = 0; i < buf.length; i++) {
|
|
10216
|
+
out += String.fromCharCode(buf[i]);
|
|
10217
|
+
}
|
|
10218
|
+
return out;
|
|
10219
|
+
},
|
|
10220
|
+
};
|
|
10221
|
+
function encode$1(decoded) {
|
|
10222
|
+
const state = new Int32Array(5);
|
|
10223
|
+
const bufLength = 1024 * 16;
|
|
10224
|
+
const subLength = bufLength - 36;
|
|
10225
|
+
const buf = new Uint8Array(bufLength);
|
|
10226
|
+
const sub = buf.subarray(0, subLength);
|
|
10227
|
+
let pos = 0;
|
|
10228
|
+
let out = '';
|
|
10229
|
+
for (let i = 0; i < decoded.length; i++) {
|
|
10230
|
+
const line = decoded[i];
|
|
10231
|
+
if (i > 0) {
|
|
10232
|
+
if (pos === bufLength) {
|
|
10233
|
+
out += td.decode(buf);
|
|
10234
|
+
pos = 0;
|
|
10235
|
+
}
|
|
10236
|
+
buf[pos++] = semicolon;
|
|
10237
|
+
}
|
|
10238
|
+
if (line.length === 0)
|
|
10239
|
+
continue;
|
|
10240
|
+
state[0] = 0;
|
|
10241
|
+
for (let j = 0; j < line.length; j++) {
|
|
10242
|
+
const segment = line[j];
|
|
10243
|
+
// We can push up to 5 ints, each int can take at most 7 chars, and we
|
|
10244
|
+
// may push a comma.
|
|
10245
|
+
if (pos > subLength) {
|
|
10246
|
+
out += td.decode(sub);
|
|
10247
|
+
buf.copyWithin(0, subLength, pos);
|
|
10248
|
+
pos -= subLength;
|
|
10249
|
+
}
|
|
10250
|
+
if (j > 0)
|
|
10251
|
+
buf[pos++] = comma;
|
|
10252
|
+
pos = encodeInteger(buf, pos, state, segment, 0); // genColumn
|
|
10253
|
+
if (segment.length === 1)
|
|
10254
|
+
continue;
|
|
10255
|
+
pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex
|
|
10256
|
+
pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine
|
|
10257
|
+
pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn
|
|
10258
|
+
if (segment.length === 4)
|
|
10259
|
+
continue;
|
|
10260
|
+
pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex
|
|
10261
|
+
}
|
|
10262
|
+
}
|
|
10263
|
+
return out + td.decode(buf.subarray(0, pos));
|
|
10264
|
+
}
|
|
10265
|
+
function encodeInteger(buf, pos, state, segment, j) {
|
|
10266
|
+
const next = segment[j];
|
|
10267
|
+
let num = next - state[j];
|
|
10268
|
+
state[j] = next;
|
|
10269
|
+
num = num < 0 ? (-num << 1) | 1 : num << 1;
|
|
10270
|
+
do {
|
|
10271
|
+
let clamped = num & 0b011111;
|
|
10272
|
+
num >>>= 5;
|
|
10273
|
+
if (num > 0)
|
|
10274
|
+
clamped |= 0b100000;
|
|
10275
|
+
buf[pos++] = intToChar[clamped];
|
|
10276
|
+
} while (num > 0);
|
|
10277
|
+
return pos;
|
|
10278
|
+
}
|
|
10279
|
+
|
|
10192
10280
|
const COLUMN = 0;
|
|
10193
10281
|
const SOURCES_INDEX = 1;
|
|
10194
10282
|
const SOURCE_LINE = 2;
|
|
@@ -10254,7 +10342,7 @@ class GenMapping {
|
|
|
10254
10342
|
};
|
|
10255
10343
|
toEncodedMap = (map) => {
|
|
10256
10344
|
const decoded = toDecodedMap(map);
|
|
10257
|
-
return Object.assign(Object.assign({}, decoded), { mappings: encode$
|
|
10345
|
+
return Object.assign(Object.assign({}, decoded), { mappings: encode$1(decoded.mappings) });
|
|
10258
10346
|
};
|
|
10259
10347
|
// Internal helpers
|
|
10260
10348
|
addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {
|
|
@@ -14817,94 +14905,6 @@ function lookup(extn) {
|
|
|
14817
14905
|
return mimes$1[!~idx ? tmp : tmp.substring(++idx)];
|
|
14818
14906
|
}
|
|
14819
14907
|
|
|
14820
|
-
const comma = ','.charCodeAt(0);
|
|
14821
|
-
const semicolon = ';'.charCodeAt(0);
|
|
14822
|
-
const chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
14823
|
-
const intToChar = new Uint8Array(64); // 64 possible chars.
|
|
14824
|
-
const charToInt = new Uint8Array(128); // z is 122 in ASCII
|
|
14825
|
-
for (let i = 0; i < chars$1.length; i++) {
|
|
14826
|
-
const c = chars$1.charCodeAt(i);
|
|
14827
|
-
intToChar[i] = c;
|
|
14828
|
-
charToInt[c] = i;
|
|
14829
|
-
}
|
|
14830
|
-
// Provide a fallback for older environments.
|
|
14831
|
-
const td = typeof TextDecoder !== 'undefined'
|
|
14832
|
-
? /* #__PURE__ */ new TextDecoder()
|
|
14833
|
-
: typeof Buffer !== 'undefined'
|
|
14834
|
-
? {
|
|
14835
|
-
decode(buf) {
|
|
14836
|
-
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
14837
|
-
return out.toString();
|
|
14838
|
-
},
|
|
14839
|
-
}
|
|
14840
|
-
: {
|
|
14841
|
-
decode(buf) {
|
|
14842
|
-
let out = '';
|
|
14843
|
-
for (let i = 0; i < buf.length; i++) {
|
|
14844
|
-
out += String.fromCharCode(buf[i]);
|
|
14845
|
-
}
|
|
14846
|
-
return out;
|
|
14847
|
-
},
|
|
14848
|
-
};
|
|
14849
|
-
function encode$1(decoded) {
|
|
14850
|
-
const state = new Int32Array(5);
|
|
14851
|
-
const bufLength = 1024 * 16;
|
|
14852
|
-
const subLength = bufLength - 36;
|
|
14853
|
-
const buf = new Uint8Array(bufLength);
|
|
14854
|
-
const sub = buf.subarray(0, subLength);
|
|
14855
|
-
let pos = 0;
|
|
14856
|
-
let out = '';
|
|
14857
|
-
for (let i = 0; i < decoded.length; i++) {
|
|
14858
|
-
const line = decoded[i];
|
|
14859
|
-
if (i > 0) {
|
|
14860
|
-
if (pos === bufLength) {
|
|
14861
|
-
out += td.decode(buf);
|
|
14862
|
-
pos = 0;
|
|
14863
|
-
}
|
|
14864
|
-
buf[pos++] = semicolon;
|
|
14865
|
-
}
|
|
14866
|
-
if (line.length === 0)
|
|
14867
|
-
continue;
|
|
14868
|
-
state[0] = 0;
|
|
14869
|
-
for (let j = 0; j < line.length; j++) {
|
|
14870
|
-
const segment = line[j];
|
|
14871
|
-
// We can push up to 5 ints, each int can take at most 7 chars, and we
|
|
14872
|
-
// may push a comma.
|
|
14873
|
-
if (pos > subLength) {
|
|
14874
|
-
out += td.decode(sub);
|
|
14875
|
-
buf.copyWithin(0, subLength, pos);
|
|
14876
|
-
pos -= subLength;
|
|
14877
|
-
}
|
|
14878
|
-
if (j > 0)
|
|
14879
|
-
buf[pos++] = comma;
|
|
14880
|
-
pos = encodeInteger(buf, pos, state, segment, 0); // genColumn
|
|
14881
|
-
if (segment.length === 1)
|
|
14882
|
-
continue;
|
|
14883
|
-
pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex
|
|
14884
|
-
pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine
|
|
14885
|
-
pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn
|
|
14886
|
-
if (segment.length === 4)
|
|
14887
|
-
continue;
|
|
14888
|
-
pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex
|
|
14889
|
-
}
|
|
14890
|
-
}
|
|
14891
|
-
return out + td.decode(buf.subarray(0, pos));
|
|
14892
|
-
}
|
|
14893
|
-
function encodeInteger(buf, pos, state, segment, j) {
|
|
14894
|
-
const next = segment[j];
|
|
14895
|
-
let num = next - state[j];
|
|
14896
|
-
state[j] = next;
|
|
14897
|
-
num = num < 0 ? (-num << 1) | 1 : num << 1;
|
|
14898
|
-
do {
|
|
14899
|
-
let clamped = num & 0b011111;
|
|
14900
|
-
num >>>= 5;
|
|
14901
|
-
if (num > 0)
|
|
14902
|
-
clamped |= 0b100000;
|
|
14903
|
-
buf[pos++] = intToChar[clamped];
|
|
14904
|
-
} while (num > 0);
|
|
14905
|
-
return pos;
|
|
14906
|
-
}
|
|
14907
|
-
|
|
14908
14908
|
class BitSet {
|
|
14909
14909
|
constructor(arg) {
|
|
14910
14910
|
this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
|
|
@@ -21791,6 +21791,10 @@ var defaultOptions = {
|
|
|
21791
21791
|
// allowed and treated as a line comment. Enabled by default when
|
|
21792
21792
|
// `ecmaVersion` >= 2023.
|
|
21793
21793
|
allowHashBang: false,
|
|
21794
|
+
// By default, the parser will verify that private properties are
|
|
21795
|
+
// only used in places where they are valid and have been declared.
|
|
21796
|
+
// Set this to false to turn such checks off.
|
|
21797
|
+
checkPrivateFields: true,
|
|
21794
21798
|
// When `locations` is on, `loc` properties holding objects with
|
|
21795
21799
|
// `start` and `end` properties in `{line, column}` form (with
|
|
21796
21800
|
// line being 1-based and column 0-based) will be attached to the
|
|
@@ -23019,6 +23023,7 @@ pp$8.exitClassBody = function() {
|
|
|
23019
23023
|
var ref = this.privateNameStack.pop();
|
|
23020
23024
|
var declared = ref.declared;
|
|
23021
23025
|
var used = ref.used;
|
|
23026
|
+
if (!this.options.checkPrivateFields) { return }
|
|
23022
23027
|
var len = this.privateNameStack.length;
|
|
23023
23028
|
var parent = len === 0 ? null : this.privateNameStack[len - 1];
|
|
23024
23029
|
for (var i = 0; i < used.length; ++i) {
|
|
@@ -24080,7 +24085,7 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
|
|
|
24080
24085
|
else { sawUnary = true; }
|
|
24081
24086
|
expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
|
|
24082
24087
|
} else if (!sawUnary && this.type === types$1.privateId) {
|
|
24083
|
-
if (forInit || this.privateNameStack.length === 0) { this.unexpected(); }
|
|
24088
|
+
if ((forInit || this.privateNameStack.length === 0) && this.options.checkPrivateFields) { this.unexpected(); }
|
|
24084
24089
|
expr = this.parsePrivateIdent();
|
|
24085
24090
|
// only could be private fields in 'in', such as #x in obj
|
|
24086
24091
|
if (this.type !== types$1._in) { this.unexpected(); }
|
|
@@ -24923,10 +24928,12 @@ pp$5.parsePrivateIdent = function() {
|
|
|
24923
24928
|
this.finishNode(node, "PrivateIdentifier");
|
|
24924
24929
|
|
|
24925
24930
|
// For validating existence
|
|
24926
|
-
if (this.
|
|
24927
|
-
this.
|
|
24928
|
-
|
|
24929
|
-
|
|
24931
|
+
if (this.options.checkPrivateFields) {
|
|
24932
|
+
if (this.privateNameStack.length === 0) {
|
|
24933
|
+
this.raise(node.start, ("Private field '#" + (node.name) + "' must be declared in an enclosing class"));
|
|
24934
|
+
} else {
|
|
24935
|
+
this.privateNameStack[this.privateNameStack.length - 1].used.push(node);
|
|
24936
|
+
}
|
|
24930
24937
|
}
|
|
24931
24938
|
|
|
24932
24939
|
return node
|
|
@@ -27326,7 +27333,7 @@ pp.readWord = function() {
|
|
|
27326
27333
|
// [walk]: util/walk.js
|
|
27327
27334
|
|
|
27328
27335
|
|
|
27329
|
-
var version$2 = "8.
|
|
27336
|
+
var version$2 = "8.10.0";
|
|
27330
27337
|
|
|
27331
27338
|
Parser$1.acorn = {
|
|
27332
27339
|
Parser: Parser$1,
|
|
@@ -38634,6 +38641,49 @@ function createCSSResolvers(config) {
|
|
|
38634
38641
|
function getCssResolversKeys(resolvers) {
|
|
38635
38642
|
return Object.keys(resolvers);
|
|
38636
38643
|
}
|
|
38644
|
+
async function compileCSSPreprocessors(id, lang, code, config) {
|
|
38645
|
+
const { preprocessorOptions, devSourcemap } = config.css ?? {};
|
|
38646
|
+
const atImportResolvers = getAtImportResolvers(config);
|
|
38647
|
+
const preProcessor = preProcessors[lang];
|
|
38648
|
+
let opts = (preprocessorOptions && preprocessorOptions[lang]) || {};
|
|
38649
|
+
// support @import from node dependencies by default
|
|
38650
|
+
switch (lang) {
|
|
38651
|
+
case "scss" /* PreprocessLang.scss */:
|
|
38652
|
+
case "sass" /* PreprocessLang.sass */:
|
|
38653
|
+
opts = {
|
|
38654
|
+
includePaths: ['node_modules'],
|
|
38655
|
+
alias: config.resolve.alias,
|
|
38656
|
+
...opts,
|
|
38657
|
+
};
|
|
38658
|
+
break;
|
|
38659
|
+
case "less" /* PreprocessLang.less */:
|
|
38660
|
+
case "styl" /* PreprocessLang.styl */:
|
|
38661
|
+
case "stylus" /* PreprocessLang.stylus */:
|
|
38662
|
+
opts = {
|
|
38663
|
+
paths: ['node_modules'],
|
|
38664
|
+
alias: config.resolve.alias,
|
|
38665
|
+
...opts,
|
|
38666
|
+
};
|
|
38667
|
+
}
|
|
38668
|
+
// important: set this for relative import resolving
|
|
38669
|
+
opts.filename = cleanUrl(id);
|
|
38670
|
+
opts.enableSourcemap = devSourcemap ?? false;
|
|
38671
|
+
const preprocessResult = await preProcessor(code, config.root, opts, atImportResolvers);
|
|
38672
|
+
if (preprocessResult.error) {
|
|
38673
|
+
throw preprocessResult.error;
|
|
38674
|
+
}
|
|
38675
|
+
let deps;
|
|
38676
|
+
if (preprocessResult.deps) {
|
|
38677
|
+
const normalizedFilename = normalizePath$3(opts.filename);
|
|
38678
|
+
// sometimes sass registers the file itself as a dep
|
|
38679
|
+
deps = new Set([...preprocessResult.deps].filter((dep) => normalizePath$3(dep) !== normalizedFilename));
|
|
38680
|
+
}
|
|
38681
|
+
return {
|
|
38682
|
+
code: preprocessResult.code,
|
|
38683
|
+
map: combineSourcemapsIfExists(opts.filename, preprocessResult.map, preprocessResult.additionalMap),
|
|
38684
|
+
deps,
|
|
38685
|
+
};
|
|
38686
|
+
}
|
|
38637
38687
|
const configToAtImportResolvers = new WeakMap();
|
|
38638
38688
|
function getAtImportResolvers(config) {
|
|
38639
38689
|
let atImportResolvers = configToAtImportResolvers.get(config);
|
|
@@ -38647,7 +38697,7 @@ async function compileCSS(id, code, config, urlReplacer) {
|
|
|
38647
38697
|
if (config.css?.transformer === 'lightningcss') {
|
|
38648
38698
|
return compileLightningCSS(id, code, config, urlReplacer);
|
|
38649
38699
|
}
|
|
38650
|
-
const { modules: modulesOptions,
|
|
38700
|
+
const { modules: modulesOptions, devSourcemap } = config.css || {};
|
|
38651
38701
|
const isModule = modulesOptions !== false && cssModuleRE.test(id);
|
|
38652
38702
|
// although at serve time it can work without processing, we do need to
|
|
38653
38703
|
// crawl them in order to register watch dependencies.
|
|
@@ -38663,52 +38713,18 @@ async function compileCSS(id, code, config, urlReplacer) {
|
|
|
38663
38713
|
!hasUrl) {
|
|
38664
38714
|
return { code, map: null };
|
|
38665
38715
|
}
|
|
38666
|
-
let preprocessorMap;
|
|
38667
38716
|
let modules;
|
|
38668
38717
|
const deps = new Set();
|
|
38669
|
-
const atImportResolvers = getAtImportResolvers(config);
|
|
38670
38718
|
// 2. pre-processors: sass etc.
|
|
38719
|
+
let preprocessorMap;
|
|
38671
38720
|
if (isPreProcessor(lang)) {
|
|
38672
|
-
const
|
|
38673
|
-
|
|
38674
|
-
|
|
38675
|
-
|
|
38676
|
-
case "scss" /* PreprocessLang.scss */:
|
|
38677
|
-
case "sass" /* PreprocessLang.sass */:
|
|
38678
|
-
opts = {
|
|
38679
|
-
includePaths: ['node_modules'],
|
|
38680
|
-
alias: config.resolve.alias,
|
|
38681
|
-
...opts,
|
|
38682
|
-
};
|
|
38683
|
-
break;
|
|
38684
|
-
case "less" /* PreprocessLang.less */:
|
|
38685
|
-
case "styl" /* PreprocessLang.styl */:
|
|
38686
|
-
case "stylus" /* PreprocessLang.stylus */:
|
|
38687
|
-
opts = {
|
|
38688
|
-
paths: ['node_modules'],
|
|
38689
|
-
alias: config.resolve.alias,
|
|
38690
|
-
...opts,
|
|
38691
|
-
};
|
|
38692
|
-
}
|
|
38693
|
-
// important: set this for relative import resolving
|
|
38694
|
-
opts.filename = cleanUrl(id);
|
|
38695
|
-
opts.enableSourcemap = devSourcemap ?? false;
|
|
38696
|
-
const preprocessResult = await preProcessor(code, config.root, opts, atImportResolvers);
|
|
38697
|
-
if (preprocessResult.error) {
|
|
38698
|
-
throw preprocessResult.error;
|
|
38699
|
-
}
|
|
38700
|
-
code = preprocessResult.code;
|
|
38701
|
-
preprocessorMap = combineSourcemapsIfExists(opts.filename, preprocessResult.map, preprocessResult.additionalMap);
|
|
38702
|
-
if (preprocessResult.deps) {
|
|
38703
|
-
preprocessResult.deps.forEach((dep) => {
|
|
38704
|
-
// sometimes sass registers the file itself as a dep
|
|
38705
|
-
if (normalizePath$3(dep) !== normalizePath$3(opts.filename)) {
|
|
38706
|
-
deps.add(dep);
|
|
38707
|
-
}
|
|
38708
|
-
});
|
|
38709
|
-
}
|
|
38721
|
+
const preprocessorResult = await compileCSSPreprocessors(id, lang, code, config);
|
|
38722
|
+
code = preprocessorResult.code;
|
|
38723
|
+
preprocessorMap = preprocessorResult.map;
|
|
38724
|
+
preprocessorResult.deps?.forEach((dep) => deps.add(dep));
|
|
38710
38725
|
}
|
|
38711
38726
|
// 3. postcss
|
|
38727
|
+
const atImportResolvers = getAtImportResolvers(config);
|
|
38712
38728
|
const postcssOptions = (postcssConfig && postcssConfig.options) || {};
|
|
38713
38729
|
const postcssPlugins = postcssConfig && postcssConfig.plugins ? postcssConfig.plugins.slice() : [];
|
|
38714
38730
|
if (needInlineImport) {
|
|
@@ -38731,10 +38747,15 @@ async function compileCSS(id, code, config, urlReplacer) {
|
|
|
38731
38747
|
return id;
|
|
38732
38748
|
},
|
|
38733
38749
|
async load(id) {
|
|
38734
|
-
const code = fs$l.
|
|
38735
|
-
const
|
|
38736
|
-
|
|
38737
|
-
|
|
38750
|
+
const code = await fs$l.promises.readFile(id, 'utf-8');
|
|
38751
|
+
const lang = id.match(CSS_LANGS_RE)?.[1];
|
|
38752
|
+
if (isPreProcessor(lang)) {
|
|
38753
|
+
const result = await compileCSSPreprocessors(id, lang, code, config);
|
|
38754
|
+
result.deps?.forEach((dep) => deps.add(dep));
|
|
38755
|
+
// TODO: support source map
|
|
38756
|
+
return result.code;
|
|
38757
|
+
}
|
|
38758
|
+
return code;
|
|
38738
38759
|
},
|
|
38739
38760
|
nameLayer(index) {
|
|
38740
38761
|
return `vite--anon-layer-${getHash(id)}-${index}`;
|
|
@@ -38874,8 +38895,8 @@ function createCachedImport(imp) {
|
|
|
38874
38895
|
return cached;
|
|
38875
38896
|
};
|
|
38876
38897
|
}
|
|
38877
|
-
const importPostcssImport = createCachedImport(() => import('./dep-
|
|
38878
|
-
const importPostcssModules = createCachedImport(() => import('./dep-
|
|
38898
|
+
const importPostcssImport = createCachedImport(() => import('./dep-9ccfaa3e.js').then(function (n) { return n.i; }));
|
|
38899
|
+
const importPostcssModules = createCachedImport(() => import('./dep-0ba93c62.js').then(function (n) { return n.i; }));
|
|
38879
38900
|
const importPostcss = createCachedImport(() => import('postcss'));
|
|
38880
38901
|
/**
|
|
38881
38902
|
* @experimental
|
|
@@ -44088,7 +44109,7 @@ async function createPluginContainer(config, moduleGraph, watcher) {
|
|
|
44088
44109
|
let id = null;
|
|
44089
44110
|
const partial = {};
|
|
44090
44111
|
for (const plugin of getSortedPlugins('resolveId')) {
|
|
44091
|
-
if (closed)
|
|
44112
|
+
if (closed && !ssr)
|
|
44092
44113
|
throwClosedServerError();
|
|
44093
44114
|
if (!plugin.resolveId)
|
|
44094
44115
|
continue;
|
|
@@ -44140,7 +44161,7 @@ async function createPluginContainer(config, moduleGraph, watcher) {
|
|
|
44140
44161
|
const ctx = new Context();
|
|
44141
44162
|
ctx.ssr = !!ssr;
|
|
44142
44163
|
for (const plugin of getSortedPlugins('load')) {
|
|
44143
|
-
if (closed)
|
|
44164
|
+
if (closed && !ssr)
|
|
44144
44165
|
throwClosedServerError();
|
|
44145
44166
|
if (!plugin.load)
|
|
44146
44167
|
continue;
|
|
@@ -44162,7 +44183,7 @@ async function createPluginContainer(config, moduleGraph, watcher) {
|
|
|
44162
44183
|
const ctx = new TransformContext(id, code, inMap);
|
|
44163
44184
|
ctx.ssr = !!ssr;
|
|
44164
44185
|
for (const plugin of getSortedPlugins('transform')) {
|
|
44165
|
-
if (closed)
|
|
44186
|
+
if (closed && !ssr)
|
|
44166
44187
|
throwClosedServerError();
|
|
44167
44188
|
if (!plugin.transform)
|
|
44168
44189
|
continue;
|
|
@@ -54644,7 +54665,7 @@ const debugLoad = createDebugger('vite:load');
|
|
|
54644
54665
|
const debugTransform = createDebugger('vite:transform');
|
|
54645
54666
|
const debugCache$1 = createDebugger('vite:cache');
|
|
54646
54667
|
function transformRequest(url, server, options = {}) {
|
|
54647
|
-
if (server._restartPromise)
|
|
54668
|
+
if (server._restartPromise && !options.ssr)
|
|
54648
54669
|
throwClosedServerError();
|
|
54649
54670
|
const cacheKey = (options.ssr ? 'ssr:' : options.html ? 'html:' : '') + url;
|
|
54650
54671
|
// This module may get invalidated while we are processing it. For example
|
|
@@ -54803,7 +54824,7 @@ async function loadAndTransform(id, url, server, options, timestamp, mod, resolv
|
|
|
54803
54824
|
err.code = isPublicFile ? ERR_LOAD_PUBLIC_URL : ERR_LOAD_URL;
|
|
54804
54825
|
throw err;
|
|
54805
54826
|
}
|
|
54806
|
-
if (server._restartPromise)
|
|
54827
|
+
if (server._restartPromise && !ssr)
|
|
54807
54828
|
throwClosedServerError();
|
|
54808
54829
|
// ensure module in graph after successful load
|
|
54809
54830
|
mod ?? (mod = await moduleGraph._ensureEntryFromUrl(url, ssr, undefined, resolved));
|
|
@@ -54846,7 +54867,7 @@ async function loadAndTransform(id, url, server, options, timestamp, mod, resolv
|
|
|
54846
54867
|
}
|
|
54847
54868
|
}
|
|
54848
54869
|
}
|
|
54849
|
-
if (server._restartPromise)
|
|
54870
|
+
if (server._restartPromise && !ssr)
|
|
54850
54871
|
throwClosedServerError();
|
|
54851
54872
|
const result = ssr && !server.config.experimental.skipSsrTransform
|
|
54852
54873
|
? await server.ssrTransform(code, map, url, originalCode)
|
|
@@ -64902,9 +64923,11 @@ async function _createServer(inlineConfig = {}, options) {
|
|
|
64902
64923
|
closeHttpServer(),
|
|
64903
64924
|
]);
|
|
64904
64925
|
// Await pending requests. We throw early in transformRequest
|
|
64905
|
-
// and in hooks if the server is closing
|
|
64906
|
-
// plugin stops pre-transforming static
|
|
64907
|
-
// is resolved sooner.
|
|
64926
|
+
// and in hooks if the server is closing for non-ssr requests,
|
|
64927
|
+
// so the import analysis plugin stops pre-transforming static
|
|
64928
|
+
// imports and this block is resolved sooner.
|
|
64929
|
+
// During SSR, we let pending requests finish to avoid exposing
|
|
64930
|
+
// the server closed error to the users.
|
|
64908
64931
|
while (server._pendingRequests.size > 0) {
|
|
64909
64932
|
await Promise.allSettled([...server._pendingRequests.values()].map((pending) => pending.request));
|
|
64910
64933
|
}
|
|
@@ -65215,8 +65238,7 @@ async function restartServer(server) {
|
|
|
65215
65238
|
return;
|
|
65216
65239
|
}
|
|
65217
65240
|
await server.close();
|
|
65218
|
-
//
|
|
65219
|
-
newServer._restartPromise = server._restartPromise;
|
|
65241
|
+
// Assign new server props to existing server instance
|
|
65220
65242
|
Object.assign(server, newServer);
|
|
65221
65243
|
const { logger, server: { port, host, middlewareMode }, } = server.config;
|
|
65222
65244
|
if (!middlewareMode) {
|
|
@@ -65237,8 +65259,6 @@ async function restartServer(server) {
|
|
|
65237
65259
|
shortcutsOptions.print = false;
|
|
65238
65260
|
bindShortcuts(newServer, shortcutsOptions);
|
|
65239
65261
|
}
|
|
65240
|
-
// new server (the current server) can restart now
|
|
65241
|
-
newServer._restartPromise = null;
|
|
65242
65262
|
}
|
|
65243
65263
|
async function updateCjsSsrExternals(server) {
|
|
65244
65264
|
if (!server._ssrExternals) {
|
package/dist/node/cli.js
CHANGED
|
@@ -2,7 +2,7 @@ import path from 'node:path';
|
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import { performance } from 'node:perf_hooks';
|
|
4
4
|
import { EventEmitter } from 'events';
|
|
5
|
-
import { C as colors, D as bindShortcuts, x as createLogger, h as resolveConfig } from './chunks/dep-
|
|
5
|
+
import { C as colors, D as bindShortcuts, x as createLogger, h as resolveConfig } from './chunks/dep-210e5610.js';
|
|
6
6
|
import { VERSION } from './constants.js';
|
|
7
7
|
import 'node:fs/promises';
|
|
8
8
|
import 'node:url';
|
|
@@ -738,7 +738,7 @@ cli
|
|
|
738
738
|
filterDuplicateOptions(options);
|
|
739
739
|
// output structure is preserved even after bundling so require()
|
|
740
740
|
// is ok here
|
|
741
|
-
const { createServer } = await import('./chunks/dep-
|
|
741
|
+
const { createServer } = await import('./chunks/dep-210e5610.js').then(function (n) { return n.I; });
|
|
742
742
|
try {
|
|
743
743
|
const server = await createServer({
|
|
744
744
|
root,
|
|
@@ -816,7 +816,7 @@ cli
|
|
|
816
816
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
|
817
817
|
.action(async (root, options) => {
|
|
818
818
|
filterDuplicateOptions(options);
|
|
819
|
-
const { build } = await import('./chunks/dep-
|
|
819
|
+
const { build } = await import('./chunks/dep-210e5610.js').then(function (n) { return n.H; });
|
|
820
820
|
const buildOptions = cleanOptions(options);
|
|
821
821
|
try {
|
|
822
822
|
await build({
|
|
@@ -844,7 +844,7 @@ cli
|
|
|
844
844
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
|
845
845
|
.action(async (root, options) => {
|
|
846
846
|
filterDuplicateOptions(options);
|
|
847
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
|
847
|
+
const { optimizeDeps } = await import('./chunks/dep-210e5610.js').then(function (n) { return n.G; });
|
|
848
848
|
try {
|
|
849
849
|
const config = await resolveConfig({
|
|
850
850
|
root,
|
|
@@ -871,7 +871,7 @@ cli
|
|
|
871
871
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
|
872
872
|
.action(async (root, options) => {
|
|
873
873
|
filterDuplicateOptions(options);
|
|
874
|
-
const { preview } = await import('./chunks/dep-
|
|
874
|
+
const { preview } = await import('./chunks/dep-210e5610.js').then(function (n) { return n.J; });
|
|
875
875
|
try {
|
|
876
876
|
const server = await preview({
|
|
877
877
|
root,
|
package/dist/node/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as isInNodeModules } from './chunks/dep-
|
|
2
|
-
export { b as build, e as buildErrorMessage, v as createFilter, x as createLogger, c as createServer, g as defineConfig, f as formatPostcssSourceMap, k as getDepOptimizationConfig, m as isDepsOptimizerEnabled, z as isFileServingAllowed, l as loadConfigFromFile, A as loadEnv, u as mergeAlias, q as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, j as resolveBaseUrl, h as resolveConfig, B as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, y as searchForWorkspaceRoot, w as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
|
1
|
+
import { i as isInNodeModules } from './chunks/dep-210e5610.js';
|
|
2
|
+
export { b as build, e as buildErrorMessage, v as createFilter, x as createLogger, c as createServer, g as defineConfig, f as formatPostcssSourceMap, k as getDepOptimizationConfig, m as isDepsOptimizerEnabled, z as isFileServingAllowed, l as loadConfigFromFile, A as loadEnv, u as mergeAlias, q as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, j as resolveBaseUrl, h as resolveConfig, B as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, y as searchForWorkspaceRoot, w as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-210e5610.js';
|
|
3
3
|
export { VERSION as version } from './constants.js';
|
|
4
4
|
export { version as esbuildVersion } from 'esbuild';
|
|
5
5
|
export { VERSION as rollupVersion } from 'rollup';
|
|
@@ -28,13 +28,13 @@ const CLIENT_ENTRY = path$3.resolve(VITE_PACKAGE_DIR, 'dist/client/client.mjs');
|
|
|
28
28
|
path$3.resolve(VITE_PACKAGE_DIR, 'dist/client/env.mjs');
|
|
29
29
|
path$3.dirname(CLIENT_ENTRY);
|
|
30
30
|
|
|
31
|
-
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
32
|
-
const intToChar = new Uint8Array(64); // 64 possible chars.
|
|
33
|
-
const charToInt = new Uint8Array(128); // z is 122 in ASCII
|
|
34
|
-
for (let i = 0; i < chars.length; i++) {
|
|
35
|
-
const c = chars.charCodeAt(i);
|
|
36
|
-
intToChar[i] = c;
|
|
37
|
-
charToInt[c] = i;
|
|
31
|
+
const chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
32
|
+
const intToChar$1 = new Uint8Array(64); // 64 possible chars.
|
|
33
|
+
const charToInt$1 = new Uint8Array(128); // z is 122 in ASCII
|
|
34
|
+
for (let i = 0; i < chars$1.length; i++) {
|
|
35
|
+
const c = chars$1.charCodeAt(i);
|
|
36
|
+
intToChar$1[i] = c;
|
|
37
|
+
charToInt$1[c] = i;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
// Matches the scheme of a URL, eg "http://"
|
|
@@ -49,6 +49,15 @@ var UrlType;
|
|
|
49
49
|
UrlType[UrlType["Absolute"] = 7] = "Absolute";
|
|
50
50
|
})(UrlType || (UrlType = {}));
|
|
51
51
|
|
|
52
|
+
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
53
|
+
const intToChar = new Uint8Array(64); // 64 possible chars.
|
|
54
|
+
const charToInt = new Uint8Array(128); // z is 122 in ASCII
|
|
55
|
+
for (let i = 0; i < chars.length; i++) {
|
|
56
|
+
const c = chars.charCodeAt(i);
|
|
57
|
+
intToChar[i] = c;
|
|
58
|
+
charToInt[c] = i;
|
|
59
|
+
}
|
|
60
|
+
|
|
52
61
|
function getDefaultExportFromCjs (x) {
|
|
53
62
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
54
63
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Evan You",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"esbuild": "^0.18.10",
|
|
71
|
-
"postcss": "^8.4.
|
|
71
|
+
"postcss": "^8.4.25",
|
|
72
72
|
"rollup": "^3.25.2"
|
|
73
73
|
},
|
|
74
74
|
"optionalDependencies": {
|
|
@@ -76,19 +76,19 @@
|
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@ampproject/remapping": "^2.2.1",
|
|
79
|
-
"@babel/parser": "^7.22.
|
|
79
|
+
"@babel/parser": "^7.22.7",
|
|
80
80
|
"@babel/types": "^7.22.5",
|
|
81
81
|
"@jridgewell/trace-mapping": "^0.3.18",
|
|
82
82
|
"@rollup/plugin-alias": "^4.0.4",
|
|
83
83
|
"@rollup/plugin-commonjs": "^25.0.2",
|
|
84
|
-
"@rollup/plugin-dynamic-import-vars": "^2.0.
|
|
84
|
+
"@rollup/plugin-dynamic-import-vars": "^2.0.4",
|
|
85
85
|
"@rollup/plugin-json": "^6.0.0",
|
|
86
86
|
"@rollup/plugin-node-resolve": "15.1.0",
|
|
87
87
|
"@rollup/plugin-typescript": "^11.1.2",
|
|
88
88
|
"@rollup/pluginutils": "^5.0.2",
|
|
89
89
|
"@types/pnpapi": "^0.0.2",
|
|
90
90
|
"@types/escape-html": "^1.0.2",
|
|
91
|
-
"acorn": "^8.
|
|
91
|
+
"acorn": "^8.10.0",
|
|
92
92
|
"acorn-walk": "^8.2.0",
|
|
93
93
|
"cac": "^6.7.14",
|
|
94
94
|
"chokidar": "^3.5.3",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"http-proxy": "^1.18.1",
|
|
110
110
|
"json-stable-stringify": "^1.0.2",
|
|
111
111
|
"launch-editor-middleware": "^2.6.0",
|
|
112
|
-
"lightningcss": "^1.21.
|
|
112
|
+
"lightningcss": "^1.21.5",
|
|
113
113
|
"magic-string": "^0.30.1",
|
|
114
114
|
"micromatch": "^4.0.5",
|
|
115
115
|
"mlly": "^1.4.0",
|