vite 6.0.7 → 6.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/client.mjs +14 -8
- package/dist/node/chunks/{dep-BJP6rrE_.js → dep-BdTvomPN.js} +501 -310
- package/dist/node/chunks/{dep-DB1BmmOk.js → dep-BurZv_3i.js} +63 -66
- package/dist/node/chunks/{dep-Cpceb51t.js → dep-CgjxNdwk.js} +1 -1
- package/dist/node/chunks/{dep-DnSxfB-q.js → dep-DcIXjcop.js} +17 -17
- package/dist/node/cli.js +19 -18
- package/dist/node/index.d.ts +49 -2
- package/dist/node/index.js +4 -3
- package/dist/node-cjs/publicUtils.cjs +5 -5
- package/package.json +5 -5
@@ -397,7 +397,7 @@ function replaceCodePoint(codePoint) {
|
|
397
397
|
if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {
|
398
398
|
return 0xfffd;
|
399
399
|
}
|
400
|
-
return (_a = decodeMap.get(codePoint)) !== null && _a !==
|
400
|
+
return (_a = decodeMap.get(codePoint)) !== null && _a !== undefined ? _a : codePoint;
|
401
401
|
}
|
402
402
|
|
403
403
|
var CharCodes;
|
@@ -641,7 +641,7 @@ class EntityDecoder {
|
|
641
641
|
var _a;
|
642
642
|
// Ensure we consumed at least one digit.
|
643
643
|
if (this.consumed <= expectedLength) {
|
644
|
-
(_a = this.errors) === null || _a ===
|
644
|
+
(_a = this.errors) === null || _a === undefined ? undefined : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
|
645
645
|
return 0;
|
646
646
|
}
|
647
647
|
// Figure out if this is a legit end of the entity
|
@@ -716,7 +716,7 @@ class EntityDecoder {
|
|
716
716
|
const { result, decodeTree } = this;
|
717
717
|
const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
|
718
718
|
this.emitNamedEntityData(result, valueLength, this.consumed);
|
719
|
-
(_a = this.errors) === null || _a ===
|
719
|
+
(_a = this.errors) === null || _a === undefined ? undefined : _a.missingSemicolonAfterCharacterReference();
|
720
720
|
return this.consumed;
|
721
721
|
}
|
722
722
|
/**
|
@@ -765,7 +765,7 @@ class EntityDecoder {
|
|
765
765
|
return this.emitNumericEntity(0, 3);
|
766
766
|
}
|
767
767
|
case EntityDecoderState.NumericStart: {
|
768
|
-
(_a = this.errors) === null || _a ===
|
768
|
+
(_a = this.errors) === null || _a === undefined ? undefined : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
|
769
769
|
return 0;
|
770
770
|
}
|
771
771
|
case EntityDecoderState.EntityStart: {
|
@@ -1236,7 +1236,7 @@ const TAG_NAME_TO_ID = new Map([
|
|
1236
1236
|
]);
|
1237
1237
|
function getTagID(tagName) {
|
1238
1238
|
var _a;
|
1239
|
-
return (_a = TAG_NAME_TO_ID.get(tagName)) !== null && _a !==
|
1239
|
+
return (_a = TAG_NAME_TO_ID.get(tagName)) !== null && _a !== undefined ? _a : TAG_ID.UNKNOWN;
|
1240
1240
|
}
|
1241
1241
|
const $ = TAG_ID;
|
1242
1242
|
const SPECIAL_ELEMENTS = {
|
@@ -1513,7 +1513,7 @@ class Tokenizer {
|
|
1513
1513
|
//Errors
|
1514
1514
|
_err(code, cpOffset = 0) {
|
1515
1515
|
var _a, _b;
|
1516
|
-
(_b = (_a = this.handler).onParseError) === null || _b ===
|
1516
|
+
(_b = (_a = this.handler).onParseError) === null || _b === undefined ? undefined : _b.call(_a, this.preprocessor.getError(code, cpOffset));
|
1517
1517
|
}
|
1518
1518
|
// NOTE: `offset` may never run across line boundaries.
|
1519
1519
|
getCurrentLocation(offset) {
|
@@ -1556,7 +1556,7 @@ class Tokenizer {
|
|
1556
1556
|
return;
|
1557
1557
|
this._runParsingLoop();
|
1558
1558
|
if (!this.paused) {
|
1559
|
-
writeCallback === null || writeCallback ===
|
1559
|
+
writeCallback === null || writeCallback === undefined ? undefined : writeCallback();
|
1560
1560
|
}
|
1561
1561
|
}
|
1562
1562
|
write(chunk, isLastChunk, writeCallback) {
|
@@ -1564,7 +1564,7 @@ class Tokenizer {
|
|
1564
1564
|
this.preprocessor.write(chunk, isLastChunk);
|
1565
1565
|
this._runParsingLoop();
|
1566
1566
|
if (!this.paused) {
|
1567
|
-
writeCallback === null || writeCallback ===
|
1567
|
+
writeCallback === null || writeCallback === undefined ? undefined : writeCallback();
|
1568
1568
|
}
|
1569
1569
|
}
|
1570
1570
|
insertHtmlAtCurrentPos(chunk) {
|
@@ -1663,7 +1663,7 @@ class Tokenizer {
|
|
1663
1663
|
if (getTokenAttr(token, this.currentAttr.name) === null) {
|
1664
1664
|
token.attrs.push(this.currentAttr);
|
1665
1665
|
if (token.location && this.currentLocation) {
|
1666
|
-
const attrLocations = ((_a = (_b = token.location).attrs) !== null && _a !==
|
1666
|
+
const attrLocations = ((_a = (_b = token.location).attrs) !== null && _a !== undefined ? _a : (_b.attrs = Object.create(null)));
|
1667
1667
|
attrLocations[this.currentAttr.name] = this.currentLocation;
|
1668
1668
|
// Set end location
|
1669
1669
|
this._leaveAttrValue();
|
@@ -5076,11 +5076,11 @@ class Parser {
|
|
5076
5076
|
if (this.onParseError) {
|
5077
5077
|
this.options.sourceCodeLocationInfo = true;
|
5078
5078
|
}
|
5079
|
-
this.document = document !== null && document !==
|
5079
|
+
this.document = document !== null && document !== undefined ? document : this.treeAdapter.createDocument();
|
5080
5080
|
this.tokenizer = new Tokenizer(this.options, this);
|
5081
5081
|
this.activeFormattingElements = new FormattingElementList(this.treeAdapter);
|
5082
5082
|
this.fragmentContextID = fragmentContext ? getTagID(this.treeAdapter.getTagName(fragmentContext)) : TAG_ID.UNKNOWN;
|
5083
|
-
this._setContextModes(fragmentContext !== null && fragmentContext !==
|
5083
|
+
this._setContextModes(fragmentContext !== null && fragmentContext !== undefined ? fragmentContext : this.document, this.fragmentContextID);
|
5084
5084
|
this.openElements = new OpenElementStack(this.document, this.treeAdapter, this);
|
5085
5085
|
}
|
5086
5086
|
// API
|
@@ -5096,7 +5096,7 @@ class Parser {
|
|
5096
5096
|
};
|
5097
5097
|
//NOTE: use a <template> element as the fragment context if no context element was provided,
|
5098
5098
|
//so we will parse in a "forgiving" manner
|
5099
|
-
fragmentContext !== null && fragmentContext !==
|
5099
|
+
fragmentContext !== null && fragmentContext !== undefined ? fragmentContext : (fragmentContext = opts.treeAdapter.createElement(TAG_NAMES.TEMPLATE, NS.HTML, []));
|
5100
5100
|
//NOTE: create a fake element which will be used as the `document` for fragment parsing.
|
5101
5101
|
//This is important for jsdom, where a new `document` cannot be created. This led to
|
5102
5102
|
//fragment parsing messing with the main `document`.
|
@@ -5123,7 +5123,7 @@ class Parser {
|
|
5123
5123
|
var _a;
|
5124
5124
|
if (!this.onParseError)
|
5125
5125
|
return;
|
5126
|
-
const loc = (_a = token.location) !== null && _a !==
|
5126
|
+
const loc = (_a = token.location) !== null && _a !== undefined ? _a : BASE_LOC;
|
5127
5127
|
const err = {
|
5128
5128
|
code,
|
5129
5129
|
startLine: loc.startLine,
|
@@ -5139,7 +5139,7 @@ class Parser {
|
|
5139
5139
|
/** @internal */
|
5140
5140
|
onItemPush(node, tid, isTop) {
|
5141
5141
|
var _a, _b;
|
5142
|
-
(_b = (_a = this.treeAdapter).onItemPush) === null || _b ===
|
5142
|
+
(_b = (_a = this.treeAdapter).onItemPush) === null || _b === undefined ? undefined : _b.call(_a, node);
|
5143
5143
|
if (isTop && this.openElements.stackTop > 0)
|
5144
5144
|
this._setContextModes(node, tid);
|
5145
5145
|
}
|
@@ -5149,7 +5149,7 @@ class Parser {
|
|
5149
5149
|
if (this.options.sourceCodeLocationInfo) {
|
5150
5150
|
this._setEndLocation(node, this.currentToken);
|
5151
5151
|
}
|
5152
|
-
(_b = (_a = this.treeAdapter).onItemPop) === null || _b ===
|
5152
|
+
(_b = (_a = this.treeAdapter).onItemPop) === null || _b === undefined ? undefined : _b.call(_a, node, this.openElements.current);
|
5153
5153
|
if (isTop) {
|
5154
5154
|
let current;
|
5155
5155
|
let currentTagId;
|
@@ -7311,7 +7311,7 @@ function eofInBody(p, token) {
|
|
7311
7311
|
function endTagInText(p, token) {
|
7312
7312
|
var _a;
|
7313
7313
|
if (token.tagID === TAG_ID.SCRIPT) {
|
7314
|
-
(_a = p.scriptHandler) === null || _a ===
|
7314
|
+
(_a = p.scriptHandler) === null || _a === undefined ? undefined : _a.call(p, p.openElements.current);
|
7315
7315
|
}
|
7316
7316
|
p.openElements.pop();
|
7317
7317
|
p.insertionMode = p.originalInsertionMode;
|
@@ -8039,7 +8039,7 @@ function endTagAfterBody(p, token) {
|
|
8039
8039
|
p._setEndLocation(p.openElements.items[0], token);
|
8040
8040
|
// Update the body element, if it doesn't have an end tag
|
8041
8041
|
const bodyElement = p.openElements.items[1];
|
8042
|
-
if (bodyElement && !((_a = p.treeAdapter.getNodeSourceCodeLocation(bodyElement)) === null || _a ===
|
8042
|
+
if (bodyElement && !((_a = p.treeAdapter.getNodeSourceCodeLocation(bodyElement)) === null || _a === undefined ? undefined : _a.endTag)) {
|
8043
8043
|
p._setEndLocation(bodyElement, token);
|
8044
8044
|
}
|
8045
8045
|
}
|
package/dist/node/cli.js
CHANGED
@@ -2,12 +2,13 @@ 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 { M as colors, G as createLogger, r as resolveConfig } from './chunks/dep-
|
5
|
+
import { M as colors, G as createLogger, r as resolveConfig } from './chunks/dep-BdTvomPN.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 'node:crypto';
|
11
12
|
import 'esbuild';
|
12
13
|
import 'path';
|
13
14
|
import 'fs';
|
@@ -23,7 +24,6 @@ import 'stream';
|
|
23
24
|
import 'os';
|
24
25
|
import 'child_process';
|
25
26
|
import 'node:os';
|
26
|
-
import 'node:crypto';
|
27
27
|
import 'node:dns';
|
28
28
|
import 'vite/module-runner';
|
29
29
|
import 'rollup/parseAst';
|
@@ -40,6 +40,7 @@ import 'zlib';
|
|
40
40
|
import 'buffer';
|
41
41
|
import 'https';
|
42
42
|
import 'tls';
|
43
|
+
import 'node:net';
|
43
44
|
import 'assert';
|
44
45
|
import 'node:querystring';
|
45
46
|
import 'node:zlib';
|
@@ -65,9 +66,9 @@ function mri2 (args, opts) {
|
|
65
66
|
var k, arr, arg, name, val, out={ _:[] };
|
66
67
|
var i=0, j=0, idx=0, len=args.length;
|
67
68
|
|
68
|
-
const alibi = opts.alias !==
|
69
|
-
const strict = opts.unknown !==
|
70
|
-
const defaults = opts.default !==
|
69
|
+
const alibi = opts.alias !== undefined;
|
70
|
+
const strict = opts.unknown !== undefined;
|
71
|
+
const defaults = opts.default !== undefined;
|
71
72
|
|
72
73
|
opts.alias = opts.alias || {};
|
73
74
|
opts.string = toArr(opts.string);
|
@@ -96,7 +97,7 @@ function mri2 (args, opts) {
|
|
96
97
|
for (k in opts.default) {
|
97
98
|
name = typeof opts.default[k];
|
98
99
|
arr = opts.alias[k] = opts.alias[k] || [];
|
99
|
-
if (opts[name] !==
|
100
|
+
if (opts[name] !== undefined) {
|
100
101
|
opts[name].push(k);
|
101
102
|
for (i=0; i < arr.length; i++) {
|
102
103
|
opts[name].push(arr[i]);
|
@@ -146,7 +147,7 @@ function mri2 (args, opts) {
|
|
146
147
|
|
147
148
|
if (defaults) {
|
148
149
|
for (k in opts.default) {
|
149
|
-
if (out[k] ===
|
150
|
+
if (out[k] === undefined) {
|
150
151
|
out[k] = opts.default[k];
|
151
152
|
}
|
152
153
|
}
|
@@ -400,7 +401,7 @@ class Command {
|
|
400
401
|
sections.push({
|
401
402
|
title: "Options",
|
402
403
|
body: options.map((option) => {
|
403
|
-
return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default ===
|
404
|
+
return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default === undefined ? "" : `(default: ${option.config.default})`}`;
|
404
405
|
}).join("\n")
|
405
406
|
});
|
406
407
|
}
|
@@ -529,8 +530,8 @@ class CAC extends EventEmitter {
|
|
529
530
|
return this;
|
530
531
|
}
|
531
532
|
unsetMatchedCommand() {
|
532
|
-
this.matchedCommand =
|
533
|
-
this.matchedCommandName =
|
533
|
+
this.matchedCommand = undefined;
|
534
|
+
this.matchedCommandName = undefined;
|
534
535
|
}
|
535
536
|
parse(argv = processArgs, {
|
536
537
|
run = true
|
@@ -610,13 +611,13 @@ class CAC extends EventEmitter {
|
|
610
611
|
const ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue;
|
611
612
|
let transforms = Object.create(null);
|
612
613
|
for (const cliOption of cliOptions) {
|
613
|
-
if (!ignoreDefault && cliOption.config.default !==
|
614
|
+
if (!ignoreDefault && cliOption.config.default !== undefined) {
|
614
615
|
for (const name of cliOption.names) {
|
615
616
|
options[name] = cliOption.config.default;
|
616
617
|
}
|
617
618
|
}
|
618
619
|
if (Array.isArray(cliOption.config.type)) {
|
619
|
-
if (transforms[cliOption.name] ===
|
620
|
+
if (transforms[cliOption.name] === undefined) {
|
620
621
|
transforms[cliOption.name] = Object.create(null);
|
621
622
|
transforms[cliOption.name]["shouldTransform"] = true;
|
622
623
|
transforms[cliOption.name]["transformFunction"] = cliOption.config.type[0];
|
@@ -674,7 +675,7 @@ const stopProfiler = (log) => {
|
|
674
675
|
`CPU profile written to ${colors.white(colors.dim(outPath))}`
|
675
676
|
)
|
676
677
|
);
|
677
|
-
profileSession =
|
678
|
+
profileSession = undefined;
|
678
679
|
res();
|
679
680
|
} else {
|
680
681
|
rej(err);
|
@@ -711,7 +712,7 @@ function cleanGlobalCLIOptions(options) {
|
|
711
712
|
}
|
712
713
|
if ("watch" in ret) {
|
713
714
|
const watch = ret.watch;
|
714
|
-
ret.watch = watch ? {} :
|
715
|
+
ret.watch = watch ? {} : undefined;
|
715
716
|
}
|
716
717
|
return ret;
|
717
718
|
}
|
@@ -740,7 +741,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
|
|
740
741
|
`[boolean] force the optimizer to ignore the cache and re-bundle`
|
741
742
|
).action(async (root, options) => {
|
742
743
|
filterDuplicateOptions(options);
|
743
|
-
const { createServer } = await import('./chunks/dep-
|
744
|
+
const { createServer } = await import('./chunks/dep-BdTvomPN.js').then(function (n) { return n.Q; });
|
744
745
|
try {
|
745
746
|
const server = await createServer({
|
746
747
|
root,
|
@@ -833,7 +834,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
833
834
|
).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as \`builder: {}\``).action(
|
834
835
|
async (root, options) => {
|
835
836
|
filterDuplicateOptions(options);
|
836
|
-
const { createBuilder } = await import('./chunks/dep-
|
837
|
+
const { createBuilder } = await import('./chunks/dep-BdTvomPN.js').then(function (n) { return n.R; });
|
837
838
|
const buildOptions = cleanGlobalCLIOptions(
|
838
839
|
cleanBuilderCLIOptions(options)
|
839
840
|
);
|
@@ -868,7 +869,7 @@ cli.command("optimize [root]", "pre-bundle dependencies").option(
|
|
868
869
|
).action(
|
869
870
|
async (root, options) => {
|
870
871
|
filterDuplicateOptions(options);
|
871
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
872
|
+
const { optimizeDeps } = await import('./chunks/dep-BdTvomPN.js').then(function (n) { return n.P; });
|
872
873
|
try {
|
873
874
|
const config = await resolveConfig(
|
874
875
|
{
|
@@ -894,7 +895,7 @@ ${e.stack}`),
|
|
894
895
|
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(
|
895
896
|
async (root, options) => {
|
896
897
|
filterDuplicateOptions(options);
|
897
|
-
const { preview } = await import('./chunks/dep-
|
898
|
+
const { preview } = await import('./chunks/dep-BdTvomPN.js').then(function (n) { return n.S; });
|
898
899
|
try {
|
899
900
|
const server = await preview({
|
900
901
|
root,
|
package/dist/node/index.d.ts
CHANGED
@@ -674,6 +674,18 @@ interface CommonServerOptions {
|
|
674
674
|
* Set to 0.0.0.0 to listen on all addresses, including LAN and public addresses.
|
675
675
|
*/
|
676
676
|
host?: string | boolean;
|
677
|
+
/**
|
678
|
+
* The hostnames that Vite is allowed to respond to.
|
679
|
+
* `localhost` and subdomains under `.localhost` and all IP addresses are allowed by default.
|
680
|
+
* When using HTTPS, this check is skipped.
|
681
|
+
*
|
682
|
+
* If a string starts with `.`, it will allow that hostname without the `.` and all subdomains under the hostname.
|
683
|
+
* For example, `.example.com` will allow `example.com`, `foo.example.com`, and `foo.bar.example.com`.
|
684
|
+
*
|
685
|
+
* If set to `true`, the server is allowed to respond to requests for any hosts.
|
686
|
+
* This is not recommended as it will be vulnerable to DNS rebinding attacks.
|
687
|
+
*/
|
688
|
+
allowedHosts?: string[] | true;
|
677
689
|
/**
|
678
690
|
* Enable TLS + HTTP/2.
|
679
691
|
* Note: this downgrades to TLS only when the proxy option is also used.
|
@@ -709,8 +721,14 @@ interface CommonServerOptions {
|
|
709
721
|
/**
|
710
722
|
* Configure CORS for the dev server.
|
711
723
|
* Uses https://github.com/expressjs/cors.
|
724
|
+
*
|
725
|
+
* When enabling this option, **we recommend setting a specific value
|
726
|
+
* rather than `true`** to avoid exposing the source code to untrusted origins.
|
727
|
+
*
|
712
728
|
* Set to `true` to allow all methods from any origin, or configure separately
|
713
729
|
* using an object.
|
730
|
+
*
|
731
|
+
* @default false
|
714
732
|
*/
|
715
733
|
cors?: CorsOptions | boolean;
|
716
734
|
/**
|
@@ -722,6 +740,12 @@ interface CommonServerOptions {
|
|
722
740
|
* https://github.com/expressjs/cors#configuration-options
|
723
741
|
*/
|
724
742
|
interface CorsOptions {
|
743
|
+
/**
|
744
|
+
* Configures the Access-Control-Allow-Origin CORS header.
|
745
|
+
*
|
746
|
+
* **We recommend setting a specific value rather than
|
747
|
+
* `true`** to avoid exposing the source code to untrusted origins.
|
748
|
+
*/
|
725
749
|
origin?: CorsOrigin | ((origin: string | undefined, cb: (err: Error, origins: CorsOrigin) => void) => void);
|
726
750
|
methods?: string | string[];
|
727
751
|
allowedHeaders?: string | string[];
|
@@ -3111,8 +3135,8 @@ interface ResolvedServerUrls {
|
|
3111
3135
|
declare function createServer(inlineConfig?: InlineConfig): Promise<ViteDevServer>;
|
3112
3136
|
|
3113
3137
|
interface ESBuildOptions extends esbuild_TransformOptions {
|
3114
|
-
include?: string | RegExp | string
|
3115
|
-
exclude?: string | RegExp | string
|
3138
|
+
include?: string | RegExp | ReadonlyArray<string | RegExp>;
|
3139
|
+
exclude?: string | RegExp | ReadonlyArray<string | RegExp>;
|
3116
3140
|
jsxInject?: string;
|
3117
3141
|
/**
|
3118
3142
|
* This option is not respected. Use `build.minify` instead.
|
@@ -3900,6 +3924,18 @@ interface LegacyOptions {
|
|
3900
3924
|
* https://github.com/vitejs/vite/discussions/14697.
|
3901
3925
|
*/
|
3902
3926
|
proxySsrExternalModules?: boolean;
|
3927
|
+
/**
|
3928
|
+
* In Vite 6.0.8 and below, WebSocket server was able to connect from any web pages. However,
|
3929
|
+
* that could be exploited by a malicious web page.
|
3930
|
+
*
|
3931
|
+
* In Vite 6.0.9+, the WebSocket server now requires a token to connect from a web page.
|
3932
|
+
* But this may break some plugins and frameworks that connects to the WebSocket server
|
3933
|
+
* on their own. Enabling this option will make Vite skip the token check.
|
3934
|
+
*
|
3935
|
+
* **We do not recommend enabling this option unless you are sure that you are fine with
|
3936
|
+
* that security weakness.**
|
3937
|
+
*/
|
3938
|
+
skipWebSocketTokenCheck?: boolean;
|
3903
3939
|
}
|
3904
3940
|
interface ResolvedWorkerOptions {
|
3905
3941
|
format: 'es' | 'iife';
|
@@ -3946,6 +3982,17 @@ type ResolvedConfig = Readonly<Omit<UserConfig, 'plugins' | 'css' | 'json' | 'as
|
|
3946
3982
|
appType: AppType;
|
3947
3983
|
experimental: ExperimentalOptions;
|
3948
3984
|
environments: Record<string, ResolvedEnvironmentOptions>;
|
3985
|
+
/**
|
3986
|
+
* The token to connect to the WebSocket server from browsers.
|
3987
|
+
*
|
3988
|
+
* We recommend using `import.meta.hot` rather than connecting
|
3989
|
+
* to the WebSocket server directly.
|
3990
|
+
* If you have a usecase that requires connecting to the WebSocket
|
3991
|
+
* server, please create an issue so that we can discuss.
|
3992
|
+
*
|
3993
|
+
* @deprecated
|
3994
|
+
*/
|
3995
|
+
webSocketToken: string;
|
3949
3996
|
} & PluginHookUtils>;
|
3950
3997
|
interface PluginHookUtils {
|
3951
3998
|
getSortedPlugins: <K extends keyof Plugin>(hookName: K) => PluginWithRequiredHook<K>[];
|
package/dist/node/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export { parseAst, parseAstAsync } from 'rollup/parseAst';
|
2
|
-
import { i as isInNodeModules, a as arraify } from './chunks/dep-
|
3
|
-
export { B as BuildEnvironment, D as DevEnvironment, f as build, m as buildErrorMessage, g as createBuilder, C as createFilter, h as createIdResolver, G as createLogger, n as createRunnableDevEnvironment, c as createServer, w as createServerHotChannel, v as createServerModuleRunner, d as defineConfig, u as fetchModule, j as formatPostcssSourceMap, J as isFileLoadingAllowed, I as isFileServingAllowed, q as isRunnableDevEnvironment, l as loadConfigFromFile, K as loadEnv, A as mergeAlias, z as mergeConfig, x as moduleRunnerTransform, y as normalizePath, o as optimizeDeps, p as perEnvironmentPlugin, b as perEnvironmentState, k as preprocessCSS, e as preview, r as resolveConfig, L as resolveEnvPrefix, E as rollupVersion, H as searchForWorkspaceRoot, F as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
2
|
+
import { i as isInNodeModules, a as arraify } from './chunks/dep-BdTvomPN.js';
|
3
|
+
export { B as BuildEnvironment, D as DevEnvironment, f as build, m as buildErrorMessage, g as createBuilder, C as createFilter, h as createIdResolver, G as createLogger, n as createRunnableDevEnvironment, c as createServer, w as createServerHotChannel, v as createServerModuleRunner, d as defineConfig, u as fetchModule, j as formatPostcssSourceMap, J as isFileLoadingAllowed, I as isFileServingAllowed, q as isRunnableDevEnvironment, l as loadConfigFromFile, K as loadEnv, A as mergeAlias, z as mergeConfig, x as moduleRunnerTransform, y as normalizePath, o as optimizeDeps, p as perEnvironmentPlugin, b as perEnvironmentState, k as preprocessCSS, e as preview, r as resolveConfig, L as resolveEnvPrefix, E as rollupVersion, H as searchForWorkspaceRoot, F as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-BdTvomPN.js';
|
4
4
|
export { DEFAULT_CLIENT_CONDITIONS as defaultClientConditions, DEFAULT_CLIENT_MAIN_FIELDS as defaultClientMainFields, DEFAULT_SERVER_CONDITIONS as defaultServerConditions, DEFAULT_SERVER_MAIN_FIELDS as defaultServerMainFields, VERSION as version } from './constants.js';
|
5
5
|
export { version as esbuildVersion } from 'esbuild';
|
6
6
|
import 'node:fs';
|
@@ -10,6 +10,7 @@ import 'node:url';
|
|
10
10
|
import 'node:util';
|
11
11
|
import 'node:perf_hooks';
|
12
12
|
import 'node:module';
|
13
|
+
import 'node:crypto';
|
13
14
|
import 'path';
|
14
15
|
import 'fs';
|
15
16
|
import 'node:child_process';
|
@@ -25,7 +26,6 @@ import 'stream';
|
|
25
26
|
import 'os';
|
26
27
|
import 'child_process';
|
27
28
|
import 'node:os';
|
28
|
-
import 'node:crypto';
|
29
29
|
import 'node:dns';
|
30
30
|
import 'vite/module-runner';
|
31
31
|
import 'module';
|
@@ -41,6 +41,7 @@ import 'zlib';
|
|
41
41
|
import 'buffer';
|
42
42
|
import 'https';
|
43
43
|
import 'tls';
|
44
|
+
import 'node:net';
|
44
45
|
import 'assert';
|
45
46
|
import 'node:querystring';
|
46
47
|
import 'node:zlib';
|
@@ -2778,7 +2778,7 @@ const parse$2 = (input, options) => {
|
|
2778
2778
|
}
|
2779
2779
|
|
2780
2780
|
if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
|
2781
|
-
const end = rest[1] !==
|
2781
|
+
const end = rest[1] !== undefined ? '|$' : '';
|
2782
2782
|
|
2783
2783
|
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
2784
2784
|
prior.output = `(?:${prior.output}`;
|
@@ -5644,7 +5644,7 @@ function clearScreen() {
|
|
5644
5644
|
}
|
5645
5645
|
let timeFormatter;
|
5646
5646
|
function getTimeFormatter() {
|
5647
|
-
timeFormatter ??= new Intl.DateTimeFormat(
|
5647
|
+
timeFormatter ??= new Intl.DateTimeFormat(undefined, {
|
5648
5648
|
hour: "numeric",
|
5649
5649
|
minute: "numeric",
|
5650
5650
|
second: "numeric"
|
@@ -6370,13 +6370,13 @@ function loadEnv(mode, envDir, prefixes = "VITE_") {
|
|
6370
6370
|
return Object.entries(parse_1(fs$1.readFileSync(filePath)));
|
6371
6371
|
})
|
6372
6372
|
);
|
6373
|
-
if (parsed.NODE_ENV && process.env.VITE_USER_NODE_ENV ===
|
6373
|
+
if (parsed.NODE_ENV && process.env.VITE_USER_NODE_ENV === undefined) {
|
6374
6374
|
process.env.VITE_USER_NODE_ENV = parsed.NODE_ENV;
|
6375
6375
|
}
|
6376
|
-
if (parsed.BROWSER && process.env.BROWSER ===
|
6376
|
+
if (parsed.BROWSER && process.env.BROWSER === undefined) {
|
6377
6377
|
process.env.BROWSER = parsed.BROWSER;
|
6378
6378
|
}
|
6379
|
-
if (parsed.BROWSER_ARGS && process.env.BROWSER_ARGS ===
|
6379
|
+
if (parsed.BROWSER_ARGS && process.env.BROWSER_ARGS === undefined) {
|
6380
6380
|
process.env.BROWSER_ARGS = parsed.BROWSER_ARGS;
|
6381
6381
|
}
|
6382
6382
|
const processEnv = { ...process.env };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vite",
|
3
|
-
"version": "6.0.
|
3
|
+
"version": "6.0.9",
|
4
4
|
"type": "module",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "Evan You",
|
@@ -103,7 +103,7 @@
|
|
103
103
|
"dep-types": "link:./src/types",
|
104
104
|
"dotenv": "^16.4.7",
|
105
105
|
"dotenv-expand": "^12.0.1",
|
106
|
-
"es-module-lexer": "^1.
|
106
|
+
"es-module-lexer": "^1.6.0",
|
107
107
|
"escape-html": "^1.0.3",
|
108
108
|
"estree-walker": "^3.0.3",
|
109
109
|
"etag": "^1.8.1",
|
@@ -116,7 +116,7 @@
|
|
116
116
|
"nanoid": "^5.0.9",
|
117
117
|
"open": "^10.1.0",
|
118
118
|
"parse5": "^7.2.1",
|
119
|
-
"pathe": "^
|
119
|
+
"pathe": "^2.0.0",
|
120
120
|
"periscopic": "^4.0.2",
|
121
121
|
"picocolors": "^1.1.1",
|
122
122
|
"picomatch": "^4.0.2",
|
@@ -127,8 +127,8 @@
|
|
127
127
|
"rollup-plugin-dts": "^6.1.1",
|
128
128
|
"rollup-plugin-esbuild": "^6.1.1",
|
129
129
|
"rollup-plugin-license": "^3.5.3",
|
130
|
-
"sass": "^1.83.
|
131
|
-
"sass-embedded": "^1.83.
|
130
|
+
"sass": "^1.83.1",
|
131
|
+
"sass-embedded": "^1.83.1",
|
132
132
|
"sirv": "^3.0.0",
|
133
133
|
"source-map-support": "^0.5.21",
|
134
134
|
"strip-literal": "^2.1.1",
|