vite 8.2.2 → 8.3.0-beta.1

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.
@@ -1,6 +1,6 @@
1
1
  import { ft as __commonJSMin, pt as __require } from "./node.js";
2
2
  import { t as require_lib } from "./lib.js";
3
- //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.26/node_modules/postcss-import/lib/format-import-prelude.js
3
+ //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.28/node_modules/postcss-import/lib/format-import-prelude.js
4
4
  var require_format_import_prelude = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5
5
  module.exports = function formatImportPrelude(layer, media, supports) {
6
6
  const parts = [];
@@ -15,7 +15,7 @@ var require_format_import_prelude = /* @__PURE__ */ __commonJSMin(((exports, mod
15
15
  };
16
16
  }));
17
17
  //#endregion
18
- //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.26/node_modules/postcss-import/lib/base64-encoded-import.js
18
+ //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.28/node_modules/postcss-import/lib/base64-encoded-import.js
19
19
  var require_base64_encoded_import = /* @__PURE__ */ __commonJSMin(((exports, module) => {
20
20
  const formatImportPrelude = require_format_import_prelude();
21
21
  module.exports = function base64EncodedConditionalImport(prelude, conditions) {
@@ -28,7 +28,7 @@ var require_base64_encoded_import = /* @__PURE__ */ __commonJSMin(((exports, mod
28
28
  };
29
29
  }));
30
30
  //#endregion
31
- //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.26/node_modules/postcss-import/lib/apply-conditions.js
31
+ //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.28/node_modules/postcss-import/lib/apply-conditions.js
32
32
  var require_apply_conditions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
33
33
  const base64EncodedConditionalImport = require_base64_encoded_import();
34
34
  module.exports = function applyConditions(bundle, atRule) {
@@ -103,7 +103,7 @@ var require_apply_conditions = /* @__PURE__ */ __commonJSMin(((exports, module)
103
103
  };
104
104
  }));
105
105
  //#endregion
106
- //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.26/node_modules/postcss-import/lib/apply-raws.js
106
+ //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.28/node_modules/postcss-import/lib/apply-raws.js
107
107
  var require_apply_raws = /* @__PURE__ */ __commonJSMin(((exports, module) => {
108
108
  module.exports = function applyRaws(bundle) {
109
109
  bundle.forEach((stmt, index) => {
@@ -114,7 +114,7 @@ var require_apply_raws = /* @__PURE__ */ __commonJSMin(((exports, module) => {
114
114
  };
115
115
  }));
116
116
  //#endregion
117
- //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.26/node_modules/postcss-import/lib/apply-styles.js
117
+ //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.28/node_modules/postcss-import/lib/apply-styles.js
118
118
  var require_apply_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
119
119
  module.exports = function applyStyles(bundle, styles) {
120
120
  styles.nodes = [];
@@ -134,7 +134,7 @@ var require_apply_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
134
134
  };
135
135
  }));
136
136
  //#endregion
137
- //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.26/node_modules/postcss-import/lib/data-url.js
137
+ //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.28/node_modules/postcss-import/lib/data-url.js
138
138
  var require_data_url = /* @__PURE__ */ __commonJSMin(((exports, module) => {
139
139
  const anyDataURLRegexp = /^data:text\/css(?:;(base64|plain))?,/i;
140
140
  const base64DataURLRegexp = /^data:text\/css;base64,/i;
@@ -153,7 +153,7 @@ var require_data_url = /* @__PURE__ */ __commonJSMin(((exports, module) => {
153
153
  };
154
154
  }));
155
155
  //#endregion
156
- //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.26/node_modules/postcss-import/lib/parse-statements.js
156
+ //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.28/node_modules/postcss-import/lib/parse-statements.js
157
157
  var require_parse_statements = /* @__PURE__ */ __commonJSMin(((exports, module) => {
158
158
  const valueParser = require_lib();
159
159
  const { stringify } = valueParser;
@@ -278,7 +278,7 @@ var require_parse_statements = /* @__PURE__ */ __commonJSMin(((exports, module)
278
278
  }
279
279
  }));
280
280
  //#endregion
281
- //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.26/node_modules/postcss-import/lib/process-content.js
281
+ //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.28/node_modules/postcss-import/lib/process-content.js
282
282
  var require_process_content = /* @__PURE__ */ __commonJSMin(((exports, module) => {
283
283
  const path$2 = __require("path");
284
284
  let sugarss;
@@ -312,7 +312,7 @@ var require_process_content = /* @__PURE__ */ __commonJSMin(((exports, module) =
312
312
  }
313
313
  }));
314
314
  //#endregion
315
- //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.26/node_modules/postcss-import/lib/parse-styles.js
315
+ //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.28/node_modules/postcss-import/lib/parse-styles.js
316
316
  var require_parse_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
317
317
  const path$1 = __require("path");
318
318
  const dataURL = require_data_url();
@@ -416,7 +416,7 @@ var require_parse_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
416
416
  module.exports = parseStyles;
417
417
  }));
418
418
  //#endregion
419
- //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.26/node_modules/postcss-import/index.js
419
+ //#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.28/node_modules/postcss-import/index.js
420
420
  var require_postcss_import = /* @__PURE__ */ __commonJSMin(((exports, module) => {
421
421
  const path = __require("path");
422
422
  const applyConditions = require_apply_conditions();
package/dist/node/cli.js CHANGED
@@ -1,8 +1,8 @@
1
- import { E as createBuilder, J as createLogger, dt as require_picocolors, lt as VERSION, mt as __toESM } from "./chunks/node.js";
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 outPath = path.resolve(`./vite-profile-${profileCount++}.cpuprofile`);
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;
@@ -648,7 +651,7 @@ const stopProfiler = (log) => {
648
651
  });
649
652
  };
650
653
  const filterDuplicateOptions = (options) => {
651
- for (const [key, value] of Object.entries(options)) if (Array.isArray(value)) options[key] = value[value.length - 1];
654
+ for (const [key, value] of Object.entries(options)) if (Array.isArray(value)) options[key] = value.at(-1);
652
655
  };
653
656
  /**
654
657
  * removing global flags before passing as command specific sub-configs
@@ -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.j);
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.O);
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.y);
809
+ const { preview } = await import("./chunks/node.js").then((n) => n.C);
806
810
  try {
807
811
  const server = await preview({
808
812
  root,