vite 8.2.2 → 8.3.0-beta.0
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/bin/vite.js +17 -6
- package/dist/client/bundledDevClient.mjs +70 -42
- package/dist/client/client.mjs +288 -260
- package/dist/node/chunks/node.js +30385 -30111
- package/dist/node/cli.js +11 -7
- package/dist/node/index.d.ts +1565 -1522
- package/dist/node/index.js +1 -1
- package/dist/node/module-runner.d.ts +1 -1
- package/dist/node/module-runner.js +191 -194
- package/package.json +12 -12
- package/types/customEvent.d.ts +8 -0
- package/types/hmrPayload.d.ts +8 -0
- package/types/internal/cssPreprocessorOptions.d.ts +2 -2
package/dist/node/cli.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { E as createBuilder,
|
|
1
|
+
import { E as createBuilder, H as createLogger, dt as require_picocolors, lt as VERSION, mt as __toESM } from "./chunks/node.js";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import { inspect } from "node:util";
|
|
5
4
|
import { performance } from "node:perf_hooks";
|
|
5
|
+
import { inspect } from "node:util";
|
|
6
6
|
//#region ../../node_modules/.pnpm/cac@7.0.0/node_modules/cac/dist/index.js
|
|
7
7
|
function toArr(any) {
|
|
8
8
|
return any == null ? [] : Array.isArray(any) ? any : [any];
|
|
@@ -638,7 +638,10 @@ const stopProfiler = (log) => {
|
|
|
638
638
|
return new Promise((res, rej) => {
|
|
639
639
|
profileSession.post("Profiler.stop", (err, { profile }) => {
|
|
640
640
|
if (!err) {
|
|
641
|
-
const
|
|
641
|
+
const name = global.__vite_profile_name;
|
|
642
|
+
const count = profileCount++;
|
|
643
|
+
const fileName = name ? count === 0 ? name : `${name}-${count}` : `vite-profile-${count}`;
|
|
644
|
+
const outPath = path.resolve(`./${fileName}.cpuprofile`);
|
|
642
645
|
fs.writeFileSync(outPath, JSON.stringify(profile));
|
|
643
646
|
log(import_picocolors.default.yellow(`CPU profile written to ${import_picocolors.default.white(import_picocolors.default.dim(outPath))}`));
|
|
644
647
|
profileSession = void 0;
|
|
@@ -663,6 +666,7 @@ function cleanGlobalCLIOptions(options) {
|
|
|
663
666
|
delete ret.logLevel;
|
|
664
667
|
delete ret.clearScreen;
|
|
665
668
|
delete ret.configLoader;
|
|
669
|
+
delete ret.profile;
|
|
666
670
|
delete ret.d;
|
|
667
671
|
delete ret.debug;
|
|
668
672
|
delete ret.f;
|
|
@@ -700,10 +704,10 @@ const convertBase = (v) => {
|
|
|
700
704
|
if (v === 0) return "";
|
|
701
705
|
return v;
|
|
702
706
|
};
|
|
703
|
-
cli.option("-c, --config <file>", `[string] use specified config file`).option("--base <path>", `[string] public base path (default: /)`, { type: [convertBase] }).option("-l, --logLevel <level>", `[string] info | warn | error | silent`).option("--clearScreen", `[boolean] allow/disable clear screen when logging`).option("--configLoader <loader>", `[string] use 'bundle' to bundle the config with Rolldown, or 'runner' (experimental) to process it on the fly, or 'native' (experimental) to load using the native runtime (default: bundle)`).option("-d, --debug [feat]", `[string | boolean] show debug logs`).option("-f, --filter <filter>", `[string] filter debug logs`).option("-m, --mode <mode>", `[string] set env mode`);
|
|
707
|
+
cli.option("-c, --config <file>", `[string] use specified config file`).option("--base <path>", `[string] public base path (default: /)`, { type: [convertBase] }).option("-l, --logLevel <level>", `[string] info | warn | error | silent`).option("--clearScreen", `[boolean] allow/disable clear screen when logging`).option("--configLoader <loader>", `[string] use 'bundle' to bundle the config with Rolldown, or 'runner' (experimental) to process it on the fly, or 'native' (experimental) to load using the native runtime (default: bundle)`).option("--profile [name]", `[boolean | string] start built-in Node.js inspector`).option("-d, --debug [feat]", `[string | boolean] show debug logs`).option("-f, --filter <filter>", `[string] filter debug logs`).option("-m, --mode <mode>", `[string] set env mode`);
|
|
704
708
|
cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--host [host]", `[string] specify hostname`, { type: [convertHost] }).option("--port <port>", `[number] specify port`).option("--open [path]", `[boolean | string] open browser on startup`).option("--cors", `[boolean] enable CORS`).option("--strictPort", `[boolean] exit if specified port is already in use`).option("--force", `[boolean] force the optimizer to ignore the cache and re-bundle`).option("--experimentalBundle", `[boolean] use experimental full bundle mode (this is highly experimental)`).action(async (root, options) => {
|
|
705
709
|
filterDuplicateOptions(options);
|
|
706
|
-
const { createServer } = await import("./chunks/node.js").then((n) => n.
|
|
710
|
+
const { createServer } = await import("./chunks/node.js").then((n) => n.P);
|
|
707
711
|
try {
|
|
708
712
|
const server = await createServer({
|
|
709
713
|
root,
|
|
@@ -785,7 +789,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
|
785
789
|
cli.command("optimize [root]", "pre-bundle dependencies (deprecated, the pre-bundle process runs automatically and does not need to be called)").option("--force", `[boolean] force the optimizer to ignore the cache and re-bundle`).action(async (root, options) => {
|
|
786
790
|
filterDuplicateOptions(options);
|
|
787
791
|
const { resolveConfig } = await import("./chunks/node.js").then((n) => n.f);
|
|
788
|
-
const { optimizeDeps } = await import("./chunks/node.js").then((n) => n.
|
|
792
|
+
const { optimizeDeps } = await import("./chunks/node.js").then((n) => n.j);
|
|
789
793
|
try {
|
|
790
794
|
await optimizeDeps(await resolveConfig({
|
|
791
795
|
root,
|
|
@@ -802,7 +806,7 @@ cli.command("optimize [root]", "pre-bundle dependencies (deprecated, the pre-bun
|
|
|
802
806
|
});
|
|
803
807
|
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(async (root, options) => {
|
|
804
808
|
filterDuplicateOptions(options);
|
|
805
|
-
const { preview } = await import("./chunks/node.js").then((n) => n.
|
|
809
|
+
const { preview } = await import("./chunks/node.js").then((n) => n.C);
|
|
806
810
|
try {
|
|
807
811
|
const server = await preview({
|
|
808
812
|
root,
|