vite 6.0.0-beta.2 → 6.0.0-beta.4
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 +61 -943
- package/README.md +4 -4
- package/bin/vite.js +5 -0
- package/dist/client/client.mjs +5 -5
- package/dist/node/chunks/dep-BkDduZ8N.js +1099 -0
- package/dist/node/chunks/{dep-D-7KCb9p.js → dep-CdoEeCn3.js} +704 -439
- package/dist/node/chunks/{dep-BHXIdTzn.js → dep-Cpgpmu8-.js} +30526 -36819
- package/dist/node/chunks/dep-Cq6WeEUK.js +7216 -0
- package/dist/node/chunks/dep-mtw2NpNs.js +589 -0
- package/dist/node/cli.js +18 -34
- package/dist/node/index.d.ts +118 -100
- package/dist/node/index.js +6 -7
- package/dist/node/module-runner.d.ts +4 -4
- package/dist/node/module-runner.js +11 -11
- package/dist/node-cjs/publicUtils.cjs +2777 -2683
- package/index.cjs +1 -1
- package/index.d.cts +1 -1
- package/package.json +17 -17
- package/dist/node/chunks/dep-BabmomGK.js +0 -993
- package/dist/node/chunks/dep-DTHr9Se7.js +0 -6843
- package/dist/node/chunks/dep-IQS-Za7F.js +0 -561
@@ -0,0 +1,589 @@
|
|
1
|
+
import { createRequire as __cjs_createRequire } from 'node:module';
|
2
|
+
|
3
|
+
const require = __cjs_createRequire(import.meta.url);
|
4
|
+
const __require = require;
|
5
|
+
var parse;
|
6
|
+
var hasRequiredParse;
|
7
|
+
|
8
|
+
function requireParse () {
|
9
|
+
if (hasRequiredParse) return parse;
|
10
|
+
hasRequiredParse = 1;
|
11
|
+
var openParentheses = "(".charCodeAt(0);
|
12
|
+
var closeParentheses = ")".charCodeAt(0);
|
13
|
+
var singleQuote = "'".charCodeAt(0);
|
14
|
+
var doubleQuote = '"'.charCodeAt(0);
|
15
|
+
var backslash = "\\".charCodeAt(0);
|
16
|
+
var slash = "/".charCodeAt(0);
|
17
|
+
var comma = ",".charCodeAt(0);
|
18
|
+
var colon = ":".charCodeAt(0);
|
19
|
+
var star = "*".charCodeAt(0);
|
20
|
+
var uLower = "u".charCodeAt(0);
|
21
|
+
var uUpper = "U".charCodeAt(0);
|
22
|
+
var plus = "+".charCodeAt(0);
|
23
|
+
var isUnicodeRange = /^[a-f0-9?-]+$/i;
|
24
|
+
|
25
|
+
parse = function(input) {
|
26
|
+
var tokens = [];
|
27
|
+
var value = input;
|
28
|
+
|
29
|
+
var next,
|
30
|
+
quote,
|
31
|
+
prev,
|
32
|
+
token,
|
33
|
+
escape,
|
34
|
+
escapePos,
|
35
|
+
whitespacePos,
|
36
|
+
parenthesesOpenPos;
|
37
|
+
var pos = 0;
|
38
|
+
var code = value.charCodeAt(pos);
|
39
|
+
var max = value.length;
|
40
|
+
var stack = [{ nodes: tokens }];
|
41
|
+
var balanced = 0;
|
42
|
+
var parent;
|
43
|
+
|
44
|
+
var name = "";
|
45
|
+
var before = "";
|
46
|
+
var after = "";
|
47
|
+
|
48
|
+
while (pos < max) {
|
49
|
+
// Whitespaces
|
50
|
+
if (code <= 32) {
|
51
|
+
next = pos;
|
52
|
+
do {
|
53
|
+
next += 1;
|
54
|
+
code = value.charCodeAt(next);
|
55
|
+
} while (code <= 32);
|
56
|
+
token = value.slice(pos, next);
|
57
|
+
|
58
|
+
prev = tokens[tokens.length - 1];
|
59
|
+
if (code === closeParentheses && balanced) {
|
60
|
+
after = token;
|
61
|
+
} else if (prev && prev.type === "div") {
|
62
|
+
prev.after = token;
|
63
|
+
prev.sourceEndIndex += token.length;
|
64
|
+
} else if (
|
65
|
+
code === comma ||
|
66
|
+
code === colon ||
|
67
|
+
(code === slash &&
|
68
|
+
value.charCodeAt(next + 1) !== star &&
|
69
|
+
(!parent ||
|
70
|
+
(parent && parent.type === "function" && parent.value !== "calc")))
|
71
|
+
) {
|
72
|
+
before = token;
|
73
|
+
} else {
|
74
|
+
tokens.push({
|
75
|
+
type: "space",
|
76
|
+
sourceIndex: pos,
|
77
|
+
sourceEndIndex: next,
|
78
|
+
value: token
|
79
|
+
});
|
80
|
+
}
|
81
|
+
|
82
|
+
pos = next;
|
83
|
+
|
84
|
+
// Quotes
|
85
|
+
} else if (code === singleQuote || code === doubleQuote) {
|
86
|
+
next = pos;
|
87
|
+
quote = code === singleQuote ? "'" : '"';
|
88
|
+
token = {
|
89
|
+
type: "string",
|
90
|
+
sourceIndex: pos,
|
91
|
+
quote: quote
|
92
|
+
};
|
93
|
+
do {
|
94
|
+
escape = false;
|
95
|
+
next = value.indexOf(quote, next + 1);
|
96
|
+
if (~next) {
|
97
|
+
escapePos = next;
|
98
|
+
while (value.charCodeAt(escapePos - 1) === backslash) {
|
99
|
+
escapePos -= 1;
|
100
|
+
escape = !escape;
|
101
|
+
}
|
102
|
+
} else {
|
103
|
+
value += quote;
|
104
|
+
next = value.length - 1;
|
105
|
+
token.unclosed = true;
|
106
|
+
}
|
107
|
+
} while (escape);
|
108
|
+
token.value = value.slice(pos + 1, next);
|
109
|
+
token.sourceEndIndex = token.unclosed ? next : next + 1;
|
110
|
+
tokens.push(token);
|
111
|
+
pos = next + 1;
|
112
|
+
code = value.charCodeAt(pos);
|
113
|
+
|
114
|
+
// Comments
|
115
|
+
} else if (code === slash && value.charCodeAt(pos + 1) === star) {
|
116
|
+
next = value.indexOf("*/", pos);
|
117
|
+
|
118
|
+
token = {
|
119
|
+
type: "comment",
|
120
|
+
sourceIndex: pos,
|
121
|
+
sourceEndIndex: next + 2
|
122
|
+
};
|
123
|
+
|
124
|
+
if (next === -1) {
|
125
|
+
token.unclosed = true;
|
126
|
+
next = value.length;
|
127
|
+
token.sourceEndIndex = next;
|
128
|
+
}
|
129
|
+
|
130
|
+
token.value = value.slice(pos + 2, next);
|
131
|
+
tokens.push(token);
|
132
|
+
|
133
|
+
pos = next + 2;
|
134
|
+
code = value.charCodeAt(pos);
|
135
|
+
|
136
|
+
// Operation within calc
|
137
|
+
} else if (
|
138
|
+
(code === slash || code === star) &&
|
139
|
+
parent &&
|
140
|
+
parent.type === "function" &&
|
141
|
+
parent.value === "calc"
|
142
|
+
) {
|
143
|
+
token = value[pos];
|
144
|
+
tokens.push({
|
145
|
+
type: "word",
|
146
|
+
sourceIndex: pos - before.length,
|
147
|
+
sourceEndIndex: pos + token.length,
|
148
|
+
value: token
|
149
|
+
});
|
150
|
+
pos += 1;
|
151
|
+
code = value.charCodeAt(pos);
|
152
|
+
|
153
|
+
// Dividers
|
154
|
+
} else if (code === slash || code === comma || code === colon) {
|
155
|
+
token = value[pos];
|
156
|
+
|
157
|
+
tokens.push({
|
158
|
+
type: "div",
|
159
|
+
sourceIndex: pos - before.length,
|
160
|
+
sourceEndIndex: pos + token.length,
|
161
|
+
value: token,
|
162
|
+
before: before,
|
163
|
+
after: ""
|
164
|
+
});
|
165
|
+
before = "";
|
166
|
+
|
167
|
+
pos += 1;
|
168
|
+
code = value.charCodeAt(pos);
|
169
|
+
|
170
|
+
// Open parentheses
|
171
|
+
} else if (openParentheses === code) {
|
172
|
+
// Whitespaces after open parentheses
|
173
|
+
next = pos;
|
174
|
+
do {
|
175
|
+
next += 1;
|
176
|
+
code = value.charCodeAt(next);
|
177
|
+
} while (code <= 32);
|
178
|
+
parenthesesOpenPos = pos;
|
179
|
+
token = {
|
180
|
+
type: "function",
|
181
|
+
sourceIndex: pos - name.length,
|
182
|
+
value: name,
|
183
|
+
before: value.slice(parenthesesOpenPos + 1, next)
|
184
|
+
};
|
185
|
+
pos = next;
|
186
|
+
|
187
|
+
if (name === "url" && code !== singleQuote && code !== doubleQuote) {
|
188
|
+
next -= 1;
|
189
|
+
do {
|
190
|
+
escape = false;
|
191
|
+
next = value.indexOf(")", next + 1);
|
192
|
+
if (~next) {
|
193
|
+
escapePos = next;
|
194
|
+
while (value.charCodeAt(escapePos - 1) === backslash) {
|
195
|
+
escapePos -= 1;
|
196
|
+
escape = !escape;
|
197
|
+
}
|
198
|
+
} else {
|
199
|
+
value += ")";
|
200
|
+
next = value.length - 1;
|
201
|
+
token.unclosed = true;
|
202
|
+
}
|
203
|
+
} while (escape);
|
204
|
+
// Whitespaces before closed
|
205
|
+
whitespacePos = next;
|
206
|
+
do {
|
207
|
+
whitespacePos -= 1;
|
208
|
+
code = value.charCodeAt(whitespacePos);
|
209
|
+
} while (code <= 32);
|
210
|
+
if (parenthesesOpenPos < whitespacePos) {
|
211
|
+
if (pos !== whitespacePos + 1) {
|
212
|
+
token.nodes = [
|
213
|
+
{
|
214
|
+
type: "word",
|
215
|
+
sourceIndex: pos,
|
216
|
+
sourceEndIndex: whitespacePos + 1,
|
217
|
+
value: value.slice(pos, whitespacePos + 1)
|
218
|
+
}
|
219
|
+
];
|
220
|
+
} else {
|
221
|
+
token.nodes = [];
|
222
|
+
}
|
223
|
+
if (token.unclosed && whitespacePos + 1 !== next) {
|
224
|
+
token.after = "";
|
225
|
+
token.nodes.push({
|
226
|
+
type: "space",
|
227
|
+
sourceIndex: whitespacePos + 1,
|
228
|
+
sourceEndIndex: next,
|
229
|
+
value: value.slice(whitespacePos + 1, next)
|
230
|
+
});
|
231
|
+
} else {
|
232
|
+
token.after = value.slice(whitespacePos + 1, next);
|
233
|
+
token.sourceEndIndex = next;
|
234
|
+
}
|
235
|
+
} else {
|
236
|
+
token.after = "";
|
237
|
+
token.nodes = [];
|
238
|
+
}
|
239
|
+
pos = next + 1;
|
240
|
+
token.sourceEndIndex = token.unclosed ? next : pos;
|
241
|
+
code = value.charCodeAt(pos);
|
242
|
+
tokens.push(token);
|
243
|
+
} else {
|
244
|
+
balanced += 1;
|
245
|
+
token.after = "";
|
246
|
+
token.sourceEndIndex = pos + 1;
|
247
|
+
tokens.push(token);
|
248
|
+
stack.push(token);
|
249
|
+
tokens = token.nodes = [];
|
250
|
+
parent = token;
|
251
|
+
}
|
252
|
+
name = "";
|
253
|
+
|
254
|
+
// Close parentheses
|
255
|
+
} else if (closeParentheses === code && balanced) {
|
256
|
+
pos += 1;
|
257
|
+
code = value.charCodeAt(pos);
|
258
|
+
|
259
|
+
parent.after = after;
|
260
|
+
parent.sourceEndIndex += after.length;
|
261
|
+
after = "";
|
262
|
+
balanced -= 1;
|
263
|
+
stack[stack.length - 1].sourceEndIndex = pos;
|
264
|
+
stack.pop();
|
265
|
+
parent = stack[balanced];
|
266
|
+
tokens = parent.nodes;
|
267
|
+
|
268
|
+
// Words
|
269
|
+
} else {
|
270
|
+
next = pos;
|
271
|
+
do {
|
272
|
+
if (code === backslash) {
|
273
|
+
next += 1;
|
274
|
+
}
|
275
|
+
next += 1;
|
276
|
+
code = value.charCodeAt(next);
|
277
|
+
} while (
|
278
|
+
next < max &&
|
279
|
+
!(
|
280
|
+
code <= 32 ||
|
281
|
+
code === singleQuote ||
|
282
|
+
code === doubleQuote ||
|
283
|
+
code === comma ||
|
284
|
+
code === colon ||
|
285
|
+
code === slash ||
|
286
|
+
code === openParentheses ||
|
287
|
+
(code === star &&
|
288
|
+
parent &&
|
289
|
+
parent.type === "function" &&
|
290
|
+
parent.value === "calc") ||
|
291
|
+
(code === slash &&
|
292
|
+
parent.type === "function" &&
|
293
|
+
parent.value === "calc") ||
|
294
|
+
(code === closeParentheses && balanced)
|
295
|
+
)
|
296
|
+
);
|
297
|
+
token = value.slice(pos, next);
|
298
|
+
|
299
|
+
if (openParentheses === code) {
|
300
|
+
name = token;
|
301
|
+
} else if (
|
302
|
+
(uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) &&
|
303
|
+
plus === token.charCodeAt(1) &&
|
304
|
+
isUnicodeRange.test(token.slice(2))
|
305
|
+
) {
|
306
|
+
tokens.push({
|
307
|
+
type: "unicode-range",
|
308
|
+
sourceIndex: pos,
|
309
|
+
sourceEndIndex: next,
|
310
|
+
value: token
|
311
|
+
});
|
312
|
+
} else {
|
313
|
+
tokens.push({
|
314
|
+
type: "word",
|
315
|
+
sourceIndex: pos,
|
316
|
+
sourceEndIndex: next,
|
317
|
+
value: token
|
318
|
+
});
|
319
|
+
}
|
320
|
+
|
321
|
+
pos = next;
|
322
|
+
}
|
323
|
+
}
|
324
|
+
|
325
|
+
for (pos = stack.length - 1; pos; pos -= 1) {
|
326
|
+
stack[pos].unclosed = true;
|
327
|
+
stack[pos].sourceEndIndex = value.length;
|
328
|
+
}
|
329
|
+
|
330
|
+
return stack[0].nodes;
|
331
|
+
};
|
332
|
+
return parse;
|
333
|
+
}
|
334
|
+
|
335
|
+
var walk;
|
336
|
+
var hasRequiredWalk;
|
337
|
+
|
338
|
+
function requireWalk () {
|
339
|
+
if (hasRequiredWalk) return walk;
|
340
|
+
hasRequiredWalk = 1;
|
341
|
+
walk = function walk(nodes, cb, bubble) {
|
342
|
+
var i, max, node, result;
|
343
|
+
|
344
|
+
for (i = 0, max = nodes.length; i < max; i += 1) {
|
345
|
+
node = nodes[i];
|
346
|
+
if (!bubble) {
|
347
|
+
result = cb(node, i, nodes);
|
348
|
+
}
|
349
|
+
|
350
|
+
if (
|
351
|
+
result !== false &&
|
352
|
+
node.type === "function" &&
|
353
|
+
Array.isArray(node.nodes)
|
354
|
+
) {
|
355
|
+
walk(node.nodes, cb, bubble);
|
356
|
+
}
|
357
|
+
|
358
|
+
if (bubble) {
|
359
|
+
cb(node, i, nodes);
|
360
|
+
}
|
361
|
+
}
|
362
|
+
};
|
363
|
+
return walk;
|
364
|
+
}
|
365
|
+
|
366
|
+
var stringify_1;
|
367
|
+
var hasRequiredStringify;
|
368
|
+
|
369
|
+
function requireStringify () {
|
370
|
+
if (hasRequiredStringify) return stringify_1;
|
371
|
+
hasRequiredStringify = 1;
|
372
|
+
function stringifyNode(node, custom) {
|
373
|
+
var type = node.type;
|
374
|
+
var value = node.value;
|
375
|
+
var buf;
|
376
|
+
var customResult;
|
377
|
+
|
378
|
+
if (custom && (customResult = custom(node)) !== undefined) {
|
379
|
+
return customResult;
|
380
|
+
} else if (type === "word" || type === "space") {
|
381
|
+
return value;
|
382
|
+
} else if (type === "string") {
|
383
|
+
buf = node.quote || "";
|
384
|
+
return buf + value + (node.unclosed ? "" : buf);
|
385
|
+
} else if (type === "comment") {
|
386
|
+
return "/*" + value + (node.unclosed ? "" : "*/");
|
387
|
+
} else if (type === "div") {
|
388
|
+
return (node.before || "") + value + (node.after || "");
|
389
|
+
} else if (Array.isArray(node.nodes)) {
|
390
|
+
buf = stringify(node.nodes, custom);
|
391
|
+
if (type !== "function") {
|
392
|
+
return buf;
|
393
|
+
}
|
394
|
+
return (
|
395
|
+
value +
|
396
|
+
"(" +
|
397
|
+
(node.before || "") +
|
398
|
+
buf +
|
399
|
+
(node.after || "") +
|
400
|
+
(node.unclosed ? "" : ")")
|
401
|
+
);
|
402
|
+
}
|
403
|
+
return value;
|
404
|
+
}
|
405
|
+
|
406
|
+
function stringify(nodes, custom) {
|
407
|
+
var result, i;
|
408
|
+
|
409
|
+
if (Array.isArray(nodes)) {
|
410
|
+
result = "";
|
411
|
+
for (i = nodes.length - 1; ~i; i -= 1) {
|
412
|
+
result = stringifyNode(nodes[i], custom) + result;
|
413
|
+
}
|
414
|
+
return result;
|
415
|
+
}
|
416
|
+
return stringifyNode(nodes, custom);
|
417
|
+
}
|
418
|
+
|
419
|
+
stringify_1 = stringify;
|
420
|
+
return stringify_1;
|
421
|
+
}
|
422
|
+
|
423
|
+
var unit;
|
424
|
+
var hasRequiredUnit;
|
425
|
+
|
426
|
+
function requireUnit () {
|
427
|
+
if (hasRequiredUnit) return unit;
|
428
|
+
hasRequiredUnit = 1;
|
429
|
+
var minus = "-".charCodeAt(0);
|
430
|
+
var plus = "+".charCodeAt(0);
|
431
|
+
var dot = ".".charCodeAt(0);
|
432
|
+
var exp = "e".charCodeAt(0);
|
433
|
+
var EXP = "E".charCodeAt(0);
|
434
|
+
|
435
|
+
// Check if three code points would start a number
|
436
|
+
// https://www.w3.org/TR/css-syntax-3/#starts-with-a-number
|
437
|
+
function likeNumber(value) {
|
438
|
+
var code = value.charCodeAt(0);
|
439
|
+
var nextCode;
|
440
|
+
|
441
|
+
if (code === plus || code === minus) {
|
442
|
+
nextCode = value.charCodeAt(1);
|
443
|
+
|
444
|
+
if (nextCode >= 48 && nextCode <= 57) {
|
445
|
+
return true;
|
446
|
+
}
|
447
|
+
|
448
|
+
var nextNextCode = value.charCodeAt(2);
|
449
|
+
|
450
|
+
if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) {
|
451
|
+
return true;
|
452
|
+
}
|
453
|
+
|
454
|
+
return false;
|
455
|
+
}
|
456
|
+
|
457
|
+
if (code === dot) {
|
458
|
+
nextCode = value.charCodeAt(1);
|
459
|
+
|
460
|
+
if (nextCode >= 48 && nextCode <= 57) {
|
461
|
+
return true;
|
462
|
+
}
|
463
|
+
|
464
|
+
return false;
|
465
|
+
}
|
466
|
+
|
467
|
+
if (code >= 48 && code <= 57) {
|
468
|
+
return true;
|
469
|
+
}
|
470
|
+
|
471
|
+
return false;
|
472
|
+
}
|
473
|
+
|
474
|
+
// Consume a number
|
475
|
+
// https://www.w3.org/TR/css-syntax-3/#consume-number
|
476
|
+
unit = function(value) {
|
477
|
+
var pos = 0;
|
478
|
+
var length = value.length;
|
479
|
+
var code;
|
480
|
+
var nextCode;
|
481
|
+
var nextNextCode;
|
482
|
+
|
483
|
+
if (length === 0 || !likeNumber(value)) {
|
484
|
+
return false;
|
485
|
+
}
|
486
|
+
|
487
|
+
code = value.charCodeAt(pos);
|
488
|
+
|
489
|
+
if (code === plus || code === minus) {
|
490
|
+
pos++;
|
491
|
+
}
|
492
|
+
|
493
|
+
while (pos < length) {
|
494
|
+
code = value.charCodeAt(pos);
|
495
|
+
|
496
|
+
if (code < 48 || code > 57) {
|
497
|
+
break;
|
498
|
+
}
|
499
|
+
|
500
|
+
pos += 1;
|
501
|
+
}
|
502
|
+
|
503
|
+
code = value.charCodeAt(pos);
|
504
|
+
nextCode = value.charCodeAt(pos + 1);
|
505
|
+
|
506
|
+
if (code === dot && nextCode >= 48 && nextCode <= 57) {
|
507
|
+
pos += 2;
|
508
|
+
|
509
|
+
while (pos < length) {
|
510
|
+
code = value.charCodeAt(pos);
|
511
|
+
|
512
|
+
if (code < 48 || code > 57) {
|
513
|
+
break;
|
514
|
+
}
|
515
|
+
|
516
|
+
pos += 1;
|
517
|
+
}
|
518
|
+
}
|
519
|
+
|
520
|
+
code = value.charCodeAt(pos);
|
521
|
+
nextCode = value.charCodeAt(pos + 1);
|
522
|
+
nextNextCode = value.charCodeAt(pos + 2);
|
523
|
+
|
524
|
+
if (
|
525
|
+
(code === exp || code === EXP) &&
|
526
|
+
((nextCode >= 48 && nextCode <= 57) ||
|
527
|
+
((nextCode === plus || nextCode === minus) &&
|
528
|
+
nextNextCode >= 48 &&
|
529
|
+
nextNextCode <= 57))
|
530
|
+
) {
|
531
|
+
pos += nextCode === plus || nextCode === minus ? 3 : 2;
|
532
|
+
|
533
|
+
while (pos < length) {
|
534
|
+
code = value.charCodeAt(pos);
|
535
|
+
|
536
|
+
if (code < 48 || code > 57) {
|
537
|
+
break;
|
538
|
+
}
|
539
|
+
|
540
|
+
pos += 1;
|
541
|
+
}
|
542
|
+
}
|
543
|
+
|
544
|
+
return {
|
545
|
+
number: value.slice(0, pos),
|
546
|
+
unit: value.slice(pos)
|
547
|
+
};
|
548
|
+
};
|
549
|
+
return unit;
|
550
|
+
}
|
551
|
+
|
552
|
+
var lib;
|
553
|
+
var hasRequiredLib;
|
554
|
+
|
555
|
+
function requireLib () {
|
556
|
+
if (hasRequiredLib) return lib;
|
557
|
+
hasRequiredLib = 1;
|
558
|
+
var parse = requireParse();
|
559
|
+
var walk = requireWalk();
|
560
|
+
var stringify = requireStringify();
|
561
|
+
|
562
|
+
function ValueParser(value) {
|
563
|
+
if (this instanceof ValueParser) {
|
564
|
+
this.nodes = parse(value);
|
565
|
+
return this;
|
566
|
+
}
|
567
|
+
return new ValueParser(value);
|
568
|
+
}
|
569
|
+
|
570
|
+
ValueParser.prototype.toString = function() {
|
571
|
+
return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
|
572
|
+
};
|
573
|
+
|
574
|
+
ValueParser.prototype.walk = function(cb, bubble) {
|
575
|
+
walk(this.nodes, cb, bubble);
|
576
|
+
return this;
|
577
|
+
};
|
578
|
+
|
579
|
+
ValueParser.unit = requireUnit();
|
580
|
+
|
581
|
+
ValueParser.walk = walk;
|
582
|
+
|
583
|
+
ValueParser.stringify = stringify;
|
584
|
+
|
585
|
+
lib = ValueParser;
|
586
|
+
return lib;
|
587
|
+
}
|
588
|
+
|
589
|
+
export { requireLib as r };
|
package/dist/node/cli.js
CHANGED
@@ -2,22 +2,19 @@ import path from 'node:path';
|
|
2
2
|
import fs__default from 'node:fs';
|
3
3
|
import { performance } from 'node:perf_hooks';
|
4
4
|
import { EventEmitter } from 'events';
|
5
|
-
import { K as colors, E as createLogger, r as resolveConfig } from './chunks/dep-
|
5
|
+
import { K as colors, E as createLogger, r as resolveConfig } from './chunks/dep-Cpgpmu8-.js';
|
6
6
|
import { VERSION } from './constants.js';
|
7
7
|
import 'node:fs/promises';
|
8
8
|
import 'node:url';
|
9
9
|
import 'node:util';
|
10
10
|
import 'node:module';
|
11
|
-
import 'tty';
|
12
11
|
import 'esbuild';
|
13
12
|
import 'path';
|
14
13
|
import 'fs';
|
15
|
-
import 'node:events';
|
16
|
-
import 'node:stream';
|
17
|
-
import 'node:string_decoder';
|
18
14
|
import 'node:child_process';
|
19
15
|
import 'node:http';
|
20
16
|
import 'node:https';
|
17
|
+
import 'tty';
|
21
18
|
import 'util';
|
22
19
|
import 'net';
|
23
20
|
import 'url';
|
@@ -31,12 +28,14 @@ import 'node:dns';
|
|
31
28
|
import 'vite/module-runner';
|
32
29
|
import 'rollup/parseAst';
|
33
30
|
import 'node:readline';
|
31
|
+
import 'node:process';
|
32
|
+
import 'node:buffer';
|
33
|
+
import 'node:events';
|
34
34
|
import 'crypto';
|
35
35
|
import 'module';
|
36
36
|
import 'node:assert';
|
37
37
|
import 'node:v8';
|
38
38
|
import 'node:worker_threads';
|
39
|
-
import 'node:buffer';
|
40
39
|
import 'zlib';
|
41
40
|
import 'buffer';
|
42
41
|
import 'https';
|
@@ -705,10 +704,15 @@ function cleanGlobalCLIOptions(options) {
|
|
705
704
|
delete ret.filter;
|
706
705
|
delete ret.m;
|
707
706
|
delete ret.mode;
|
707
|
+
delete ret.w;
|
708
708
|
if ("sourcemap" in ret) {
|
709
709
|
const sourcemap = ret.sourcemap;
|
710
710
|
ret.sourcemap = sourcemap === "true" ? true : sourcemap === "false" ? false : ret.sourcemap;
|
711
711
|
}
|
712
|
+
if ("watch" in ret) {
|
713
|
+
const watch = ret.watch;
|
714
|
+
ret.watch = watch ? {} : void 0;
|
715
|
+
}
|
712
716
|
return ret;
|
713
717
|
}
|
714
718
|
function cleanBuilderCLIOptions(options) {
|
@@ -736,7 +740,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
|
|
736
740
|
`[boolean] force the optimizer to ignore the cache and re-bundle`
|
737
741
|
).action(async (root, options) => {
|
738
742
|
filterDuplicateOptions(options);
|
739
|
-
const { createServer } = await import('./chunks/dep-
|
743
|
+
const { createServer } = await import('./chunks/dep-Cpgpmu8-.js').then(function (n) { return n.O; });
|
740
744
|
try {
|
741
745
|
const server = await createServer({
|
742
746
|
root,
|
@@ -826,10 +830,10 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
826
830
|
).option("--manifest [name]", `[boolean | string] emit build manifest json`).option("--ssrManifest [name]", `[boolean | string] emit ssr manifest json`).option(
|
827
831
|
"--emptyOutDir",
|
828
832
|
`[boolean] force empty outDir when it's outside of root`
|
829
|
-
).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as builder
|
833
|
+
).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as \`builder: {}\``).action(
|
830
834
|
async (root, options) => {
|
831
835
|
filterDuplicateOptions(options);
|
832
|
-
const
|
836
|
+
const { createBuilder } = await import('./chunks/dep-Cpgpmu8-.js').then(function (n) { return n.P; });
|
833
837
|
const buildOptions = cleanGlobalCLIOptions(
|
834
838
|
cleanBuilderCLIOptions(options)
|
835
839
|
);
|
@@ -842,30 +846,10 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
842
846
|
logLevel: options.logLevel,
|
843
847
|
clearScreen: options.clearScreen,
|
844
848
|
build: buildOptions,
|
845
|
-
...options.app ? { builder: {
|
849
|
+
...options.app ? { builder: {} } : {}
|
846
850
|
};
|
847
|
-
const
|
848
|
-
|
849
|
-
return;
|
850
|
-
}
|
851
|
-
const environmentName = resolved.build.ssr ? "ssr" : "client";
|
852
|
-
resolved.build = {
|
853
|
-
...resolved.environments[environmentName].build
|
854
|
-
};
|
855
|
-
};
|
856
|
-
const config = await build.resolveConfigToBuild(
|
857
|
-
inlineConfig,
|
858
|
-
patchConfig
|
859
|
-
);
|
860
|
-
if (config.builder.entireApp) {
|
861
|
-
const builder = await build.createBuilderWithResolvedConfig(
|
862
|
-
inlineConfig,
|
863
|
-
config
|
864
|
-
);
|
865
|
-
await builder.buildApp();
|
866
|
-
} else {
|
867
|
-
await build.buildWithResolvedConfig(config);
|
868
|
-
}
|
851
|
+
const builder = await createBuilder(inlineConfig, null);
|
852
|
+
await builder.buildApp();
|
869
853
|
} catch (e) {
|
870
854
|
createLogger(options.logLevel).error(
|
871
855
|
colors.red(`error during build:
|
@@ -884,7 +868,7 @@ cli.command("optimize [root]", "pre-bundle dependencies").option(
|
|
884
868
|
).action(
|
885
869
|
async (root, options) => {
|
886
870
|
filterDuplicateOptions(options);
|
887
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
871
|
+
const { optimizeDeps } = await import('./chunks/dep-Cpgpmu8-.js').then(function (n) { return n.N; });
|
888
872
|
try {
|
889
873
|
const config = await resolveConfig(
|
890
874
|
{
|
@@ -910,7 +894,7 @@ ${e.stack}`),
|
|
910
894
|
cli.command("preview [root]", "locally preview production build").option("--host [host]", `[string] specify hostname`, { type: [convertHost] }).option("--port <port>", `[number] specify port`).option("--strictPort", `[boolean] exit if specified port is already in use`).option("--open [path]", `[boolean | string] open browser on startup`).option("--outDir <dir>", `[string] output directory (default: dist)`).action(
|
911
895
|
async (root, options) => {
|
912
896
|
filterDuplicateOptions(options);
|
913
|
-
const { preview } = await import('./chunks/dep-
|
897
|
+
const { preview } = await import('./chunks/dep-Cpgpmu8-.js').then(function (n) { return n.Q; });
|
914
898
|
try {
|
915
899
|
const server = await preview({
|
916
900
|
root,
|