vite 7.2.6 → 7.2.7
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/node/chunks/config.js +29 -23
- package/package.json +1 -1
|
@@ -5235,7 +5235,7 @@ function throttle(fn) {
|
|
|
5235
5235
|
}
|
|
5236
5236
|
|
|
5237
5237
|
//#endregion
|
|
5238
|
-
//#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.
|
|
5238
|
+
//#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.3/node_modules/tsconfck/src/util.js
|
|
5239
5239
|
const POSIX_SEP_RE = new RegExp("\\" + path.posix.sep, "g");
|
|
5240
5240
|
const NATIVE_SEP_RE = new RegExp("\\" + path.sep, "g");
|
|
5241
5241
|
/** @type {Map<string,RegExp>}*/
|
|
@@ -5458,7 +5458,7 @@ function replaceTokens(result) {
|
|
|
5458
5458
|
}
|
|
5459
5459
|
|
|
5460
5460
|
//#endregion
|
|
5461
|
-
//#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.
|
|
5461
|
+
//#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.3/node_modules/tsconfck/src/find.js
|
|
5462
5462
|
/**
|
|
5463
5463
|
* find the closest tsconfig.json file
|
|
5464
5464
|
*
|
|
@@ -5517,7 +5517,7 @@ function findUp(dir, { resolve: resolve$4, reject, promise }, options$1) {
|
|
|
5517
5517
|
}
|
|
5518
5518
|
|
|
5519
5519
|
//#endregion
|
|
5520
|
-
//#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.
|
|
5520
|
+
//#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.3/node_modules/tsconfck/src/to-json.js
|
|
5521
5521
|
/**
|
|
5522
5522
|
* convert content of tsconfig.json to regular json
|
|
5523
5523
|
*
|
|
@@ -5645,7 +5645,7 @@ function stripBom(string) {
|
|
|
5645
5645
|
}
|
|
5646
5646
|
|
|
5647
5647
|
//#endregion
|
|
5648
|
-
//#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.
|
|
5648
|
+
//#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.3/node_modules/tsconfck/src/parse.js
|
|
5649
5649
|
const not_found_result = {
|
|
5650
5650
|
tsconfigFile: null,
|
|
5651
5651
|
tsconfig: {}
|
|
@@ -5934,7 +5934,7 @@ function isJSConfig(configFileName) {
|
|
|
5934
5934
|
}
|
|
5935
5935
|
|
|
5936
5936
|
//#endregion
|
|
5937
|
-
//#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.
|
|
5937
|
+
//#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.3/node_modules/tsconfck/src/parse-native.js
|
|
5938
5938
|
/** @typedef TSDiagnosticError {
|
|
5939
5939
|
code: number;
|
|
5940
5940
|
category: number;
|
|
@@ -5943,7 +5943,7 @@ start?: number;
|
|
|
5943
5943
|
} TSDiagnosticError */
|
|
5944
5944
|
|
|
5945
5945
|
//#endregion
|
|
5946
|
-
//#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.
|
|
5946
|
+
//#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.3/node_modules/tsconfck/src/cache.js
|
|
5947
5947
|
/** @template T */
|
|
5948
5948
|
var TSConfckCache = class {
|
|
5949
5949
|
/**
|
|
@@ -16568,9 +16568,11 @@ var import_picocolors$23 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
|
16568
16568
|
function bindCLIShortcuts(server, opts, enabled = process.stdin.isTTY && !process.env.CI) {
|
|
16569
16569
|
if (!server.httpServer || !enabled) return;
|
|
16570
16570
|
const isDev = isDevServer(server);
|
|
16571
|
-
const
|
|
16572
|
-
|
|
16573
|
-
|
|
16571
|
+
const previousShortcuts = server._shortcutsState?.options.customShortcuts ?? [];
|
|
16572
|
+
const newShortcuts = opts?.customShortcuts ?? [];
|
|
16573
|
+
const previousKeys = new Set(previousShortcuts.map((s) => s.key));
|
|
16574
|
+
const customShortcuts = [...newShortcuts.filter((s) => !previousKeys.has(s.key)), ...previousShortcuts.map((s) => newShortcuts.find((n$2) => n$2.key === s.key) ?? s)];
|
|
16575
|
+
const newOptions = {
|
|
16574
16576
|
...opts,
|
|
16575
16577
|
customShortcuts
|
|
16576
16578
|
};
|
|
@@ -16596,12 +16598,19 @@ function bindCLIShortcuts(server, opts, enabled = process.stdin.isTTY && !proces
|
|
|
16596
16598
|
await shortcut.action(server);
|
|
16597
16599
|
actionRunning = false;
|
|
16598
16600
|
};
|
|
16599
|
-
if (!server.
|
|
16600
|
-
|
|
16601
|
-
|
|
16602
|
-
|
|
16603
|
-
|
|
16604
|
-
|
|
16601
|
+
if (!server._shortcutsState) {
|
|
16602
|
+
server._shortcutsState = {
|
|
16603
|
+
rl: readline.createInterface({ input: process.stdin }),
|
|
16604
|
+
options: newOptions
|
|
16605
|
+
};
|
|
16606
|
+
server.httpServer.on("close", () => {
|
|
16607
|
+
if (server._shortcutsState) server._shortcutsState.rl.close();
|
|
16608
|
+
});
|
|
16609
|
+
} else {
|
|
16610
|
+
server._shortcutsState.rl.removeAllListeners("line");
|
|
16611
|
+
server._shortcutsState.options = newOptions;
|
|
16612
|
+
}
|
|
16613
|
+
server._shortcutsState.rl.on("line", onInput);
|
|
16605
16614
|
}
|
|
16606
16615
|
const BASE_DEV_SHORTCUTS = [
|
|
16607
16616
|
{
|
|
@@ -25522,7 +25531,7 @@ async function _createServer(inlineConfig = {}, options$1) {
|
|
|
25522
25531
|
},
|
|
25523
25532
|
_restartPromise: null,
|
|
25524
25533
|
_forceOptimizeOnRestart: false,
|
|
25525
|
-
|
|
25534
|
+
_shortcutsState: options$1.previousShortcutsState
|
|
25526
25535
|
};
|
|
25527
25536
|
const reflexServer = new Proxy(server, {
|
|
25528
25537
|
get: (_, property) => {
|
|
@@ -25749,7 +25758,6 @@ function resolveServerOptions(root, raw, logger) {
|
|
|
25749
25758
|
}
|
|
25750
25759
|
async function restartServer(server) {
|
|
25751
25760
|
global.__vite_start_time = performance$1.now();
|
|
25752
|
-
const shortcutsOptions = server._shortcutsOptions;
|
|
25753
25761
|
let inlineConfig = server.config.inlineConfig;
|
|
25754
25762
|
if (server._forceOptimizeOnRestart) inlineConfig = mergeConfig(inlineConfig, { forceOptimizeDeps: true });
|
|
25755
25763
|
{
|
|
@@ -25757,18 +25765,19 @@ async function restartServer(server) {
|
|
|
25757
25765
|
try {
|
|
25758
25766
|
newServer = await _createServer(inlineConfig, {
|
|
25759
25767
|
listen: false,
|
|
25760
|
-
previousEnvironments: server.environments
|
|
25768
|
+
previousEnvironments: server.environments,
|
|
25769
|
+
previousShortcutsState: server._shortcutsState
|
|
25761
25770
|
});
|
|
25762
25771
|
} catch (err$2) {
|
|
25763
25772
|
server.config.logger.error(err$2.message, { timestamp: true });
|
|
25764
25773
|
server.config.logger.error("server restart failed", { timestamp: true });
|
|
25765
25774
|
return;
|
|
25766
25775
|
}
|
|
25776
|
+
server._shortcutsState = void 0;
|
|
25767
25777
|
await server.close();
|
|
25768
25778
|
const middlewares = server.middlewares;
|
|
25769
25779
|
newServer._configServerPort = server._configServerPort;
|
|
25770
25780
|
newServer._currentServerPort = server._currentServerPort;
|
|
25771
|
-
newServer._rl = void 0;
|
|
25772
25781
|
Object.assign(server, newServer);
|
|
25773
25782
|
middlewares.stack = newServer.middlewares.stack;
|
|
25774
25783
|
server.middlewares = middlewares;
|
|
@@ -25778,10 +25787,7 @@ async function restartServer(server) {
|
|
|
25778
25787
|
if (!middlewareMode) await server.listen(port, true);
|
|
25779
25788
|
else await Promise.all(Object.values(server.environments).map((e$1) => e$1.listen(server)));
|
|
25780
25789
|
logger.info("server restarted.", { timestamp: true });
|
|
25781
|
-
if (
|
|
25782
|
-
shortcutsOptions.print = false;
|
|
25783
|
-
bindCLIShortcuts(server, shortcutsOptions, true);
|
|
25784
|
-
}
|
|
25790
|
+
if (server._shortcutsState?.options) bindCLIShortcuts(server, { print: false }, true);
|
|
25785
25791
|
}
|
|
25786
25792
|
/**
|
|
25787
25793
|
* Internal function to restart the Vite server and print URLs if changed
|