vite 6.0.0-beta.3 → 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.
@@ -1,17 +1,13 @@
1
- import { M as commonjsGlobal, L as getDefaultExportFromCjs } from './dep-ChZnDG_O.js';
2
- import require$$0__default from 'fs';
1
+ import { M as commonjsGlobal, L as getDefaultExportFromCjs } from './dep-Cpgpmu8-.js';
2
+ import require$$0$3 from 'fs';
3
3
  import require$$0$1 from 'postcss';
4
4
  import require$$0 from 'path';
5
5
  import require$$3 from 'crypto';
6
6
  import require$$0$2 from 'util';
7
- import { r as requireLib } from './dep-wWOLM6NS.js';
7
+ import { r as requireLib } from './dep-mtw2NpNs.js';
8
8
 
9
- import { fileURLToPath as __cjs_fileURLToPath } from 'node:url';
10
- import { dirname as __cjs_dirname } from 'node:path';
11
9
  import { createRequire as __cjs_createRequire } from 'node:module';
12
10
 
13
- const __filename = __cjs_fileURLToPath(import.meta.url);
14
- const __dirname = __cjs_dirname(__filename);
15
11
  const require = __cjs_createRequire(import.meta.url);
16
12
  const __require = require;
17
13
  function _mergeNamespaces(n, m) {
@@ -7192,7 +7188,7 @@ function requireBuild () {
7192
7188
  if (hasRequiredBuild) return build.exports;
7193
7189
  hasRequiredBuild = 1;
7194
7190
 
7195
- var _fs = require$$0__default;
7191
+ var _fs = require$$0$3;
7196
7192
 
7197
7193
  var _fs2 = requireFs();
7198
7194
 
@@ -1,9 +1,5 @@
1
- import { fileURLToPath as __cjs_fileURLToPath } from 'node:url';
2
- import { dirname as __cjs_dirname } from 'node:path';
3
1
  import { createRequire as __cjs_createRequire } from 'node:module';
4
2
 
5
- const __filename = __cjs_fileURLToPath(import.meta.url);
6
- const __dirname = __cjs_dirname(__filename);
7
3
  const require = __cjs_createRequire(import.meta.url);
8
4
  const __require = require;
9
5
  var parse;
package/dist/node/cli.js CHANGED
@@ -1,20 +1,20 @@
1
1
  import path from 'node:path';
2
- import fs from 'node:fs';
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-ChZnDG_O.js';
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
14
  import 'node:child_process';
16
15
  import 'node:http';
17
16
  import 'node:https';
17
+ import 'tty';
18
18
  import 'util';
19
19
  import 'net';
20
20
  import 'url';
@@ -28,13 +28,14 @@ import 'node:dns';
28
28
  import 'vite/module-runner';
29
29
  import 'rollup/parseAst';
30
30
  import 'node:readline';
31
+ import 'node:process';
32
+ import 'node:buffer';
31
33
  import 'node:events';
32
34
  import 'crypto';
33
35
  import 'module';
34
36
  import 'node:assert';
35
37
  import 'node:v8';
36
38
  import 'node:worker_threads';
37
- import 'node:buffer';
38
39
  import 'zlib';
39
40
  import 'buffer';
40
41
  import 'https';
@@ -667,7 +668,7 @@ const stopProfiler = (log) => {
667
668
  const outPath = path.resolve(
668
669
  `./vite-profile-${profileCount++}.cpuprofile`
669
670
  );
670
- fs.writeFileSync(outPath, JSON.stringify(profile));
671
+ fs__default.writeFileSync(outPath, JSON.stringify(profile));
671
672
  log(
672
673
  colors.yellow(
673
674
  `CPU profile written to ${colors.white(colors.dim(outPath))}`
@@ -703,10 +704,15 @@ function cleanGlobalCLIOptions(options) {
703
704
  delete ret.filter;
704
705
  delete ret.m;
705
706
  delete ret.mode;
707
+ delete ret.w;
706
708
  if ("sourcemap" in ret) {
707
709
  const sourcemap = ret.sourcemap;
708
710
  ret.sourcemap = sourcemap === "true" ? true : sourcemap === "false" ? false : ret.sourcemap;
709
711
  }
712
+ if ("watch" in ret) {
713
+ const watch = ret.watch;
714
+ ret.watch = watch ? {} : void 0;
715
+ }
710
716
  return ret;
711
717
  }
712
718
  function cleanBuilderCLIOptions(options) {
@@ -734,7 +740,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
734
740
  `[boolean] force the optimizer to ignore the cache and re-bundle`
735
741
  ).action(async (root, options) => {
736
742
  filterDuplicateOptions(options);
737
- const { createServer } = await import('./chunks/dep-ChZnDG_O.js').then(function (n) { return n.O; });
743
+ const { createServer } = await import('./chunks/dep-Cpgpmu8-.js').then(function (n) { return n.O; });
738
744
  try {
739
745
  const server = await createServer({
740
746
  root,
@@ -824,10 +830,10 @@ cli.command("build [root]", "build for production").option("--target <target>",
824
830
  ).option("--manifest [name]", `[boolean | string] emit build manifest json`).option("--ssrManifest [name]", `[boolean | string] emit ssr manifest json`).option(
825
831
  "--emptyOutDir",
826
832
  `[boolean] force empty outDir when it's outside of root`
827
- ).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as builder.entireApp`).action(
833
+ ).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as \`builder: {}\``).action(
828
834
  async (root, options) => {
829
835
  filterDuplicateOptions(options);
830
- const build = await import('./chunks/dep-ChZnDG_O.js').then(function (n) { return n.P; });
836
+ const { createBuilder } = await import('./chunks/dep-Cpgpmu8-.js').then(function (n) { return n.P; });
831
837
  const buildOptions = cleanGlobalCLIOptions(
832
838
  cleanBuilderCLIOptions(options)
833
839
  );
@@ -840,30 +846,10 @@ cli.command("build [root]", "build for production").option("--target <target>",
840
846
  logLevel: options.logLevel,
841
847
  clearScreen: options.clearScreen,
842
848
  build: buildOptions,
843
- ...options.app ? { builder: { entireApp: true } } : {}
849
+ ...options.app ? { builder: {} } : {}
844
850
  };
845
- const patchConfig = (resolved) => {
846
- if (resolved.builder.entireApp) {
847
- return;
848
- }
849
- const environmentName = resolved.build.ssr ? "ssr" : "client";
850
- resolved.build = {
851
- ...resolved.environments[environmentName].build
852
- };
853
- };
854
- const config = await build.resolveConfigToBuild(
855
- inlineConfig,
856
- patchConfig
857
- );
858
- if (config.builder.entireApp) {
859
- const builder = await build.createBuilderWithResolvedConfig(
860
- inlineConfig,
861
- config
862
- );
863
- await builder.buildApp();
864
- } else {
865
- await build.buildWithResolvedConfig(config);
866
- }
851
+ const builder = await createBuilder(inlineConfig, null);
852
+ await builder.buildApp();
867
853
  } catch (e) {
868
854
  createLogger(options.logLevel).error(
869
855
  colors.red(`error during build:
@@ -882,7 +868,7 @@ cli.command("optimize [root]", "pre-bundle dependencies").option(
882
868
  ).action(
883
869
  async (root, options) => {
884
870
  filterDuplicateOptions(options);
885
- const { optimizeDeps } = await import('./chunks/dep-ChZnDG_O.js').then(function (n) { return n.N; });
871
+ const { optimizeDeps } = await import('./chunks/dep-Cpgpmu8-.js').then(function (n) { return n.N; });
886
872
  try {
887
873
  const config = await resolveConfig(
888
874
  {
@@ -908,7 +894,7 @@ ${e.stack}`),
908
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(
909
895
  async (root, options) => {
910
896
  filterDuplicateOptions(options);
911
- const { preview } = await import('./chunks/dep-ChZnDG_O.js').then(function (n) { return n.Q; });
897
+ const { preview } = await import('./chunks/dep-Cpgpmu8-.js').then(function (n) { return n.Q; });
912
898
  try {
913
899
  const server = await preview({
914
900
  root,
@@ -921,8 +921,8 @@ type DepOptimizationOptions = DepOptimizationConfig & {
921
921
  * will crawl those entry points instead.
922
922
  *
923
923
  * If neither of these fit your needs, you can specify custom entries using
924
- * this option - the value should be a fast-glob pattern or array of patterns
925
- * (https://github.com/mrmlnc/fast-glob#basic-syntax) that are relative from
924
+ * this option - the value should be a tinyglobby pattern or array of patterns
925
+ * (https://github.com/SuperchupuDev/tinyglobby) that are relative from
926
926
  * vite project root. This will overwrite default entries inference.
927
927
  */
928
928
  entries?: string | string[];
@@ -1278,7 +1278,20 @@ declare class DevEnvironment extends BaseEnvironment {
1278
1278
  constructor(name: string, config: ResolvedConfig, context: DevEnvironmentContext);
1279
1279
  init(options?: {
1280
1280
  watcher?: FSWatcher;
1281
+ /**
1282
+ * the previous instance used for the environment with the same name
1283
+ *
1284
+ * when using, the consumer should check if it's an instance generated from the same class or factory function
1285
+ */
1286
+ previousInstance?: DevEnvironment;
1281
1287
  }): Promise<void>;
1288
+ /**
1289
+ * When the dev server is restarted, the methods are called in the following order:
1290
+ * - new instance `init`
1291
+ * - previous instance `close`
1292
+ * - new instance `listen`
1293
+ */
1294
+ listen(server: ViteDevServer): Promise<void>;
1282
1295
  fetchModule(id: string, importer?: string, options?: FetchFunctionOptions): Promise<FetchResult>;
1283
1296
  reloadModule(module: EnvironmentModuleNode): Promise<void>;
1284
1297
  transformRequest(url: string): Promise<TransformResult | null>;
@@ -1827,7 +1840,6 @@ interface ResolvePluginOptions {
1827
1840
  isRequire?: boolean;
1828
1841
  webCompatible?: boolean;
1829
1842
  isFromTsImporter?: boolean;
1830
- tryEsmOnly?: boolean;
1831
1843
  scan?: boolean;
1832
1844
  ssrOptimizeCheck?: boolean;
1833
1845
  /**
@@ -2135,14 +2147,14 @@ interface ViteBuilder {
2135
2147
  interface BuilderOptions {
2136
2148
  sharedConfigBuild?: boolean;
2137
2149
  sharedPlugins?: boolean;
2138
- entireApp?: boolean;
2139
2150
  buildApp?: (builder: ViteBuilder) => Promise<void>;
2140
2151
  }
2141
2152
  type ResolvedBuilderOptions = Required<BuilderOptions>;
2142
2153
  /**
2143
2154
  * Creates a ViteBuilder to orchestrate building multiple environments.
2155
+ * @experimental
2144
2156
  */
2145
- declare function createBuilder(inlineConfig?: InlineConfig): Promise<ViteBuilder>;
2157
+ declare function createBuilder(inlineConfig?: InlineConfig, useLegacyBuilder?: null | boolean): Promise<ViteBuilder>;
2146
2158
 
2147
2159
  type Environment = DevEnvironment | BuildEnvironment | UnknownEnvironment;
2148
2160
 
@@ -3709,6 +3721,7 @@ interface UserConfig extends DefaultEnvironmentOptions {
3709
3721
  assetsInclude?: string | RegExp | (string | RegExp)[];
3710
3722
  /**
3711
3723
  * Builder specific options
3724
+ * @experimental
3712
3725
  */
3713
3726
  builder?: BuilderOptions;
3714
3727
  /**
@@ -3897,7 +3910,8 @@ type ResolvedConfig = Readonly<Omit<UserConfig, 'plugins' | 'css' | 'assetsInclu
3897
3910
  esbuild: ESBuildOptions | false;
3898
3911
  server: ResolvedServerOptions;
3899
3912
  dev: ResolvedDevEnvironmentOptions;
3900
- builder: ResolvedBuilderOptions;
3913
+ /** @experimental */
3914
+ builder: ResolvedBuilderOptions | undefined;
3901
3915
  build: ResolvedBuildOptions;
3902
3916
  preview: ResolvedPreviewOptions;
3903
3917
  ssr: ResolvedSSROptions;
@@ -1,6 +1,6 @@
1
1
  export { parseAst, parseAstAsync } from 'rollup/parseAst';
2
- import { i as isInNodeModules, a as arraify } from './chunks/dep-ChZnDG_O.js';
3
- export { B as BuildEnvironment, D as DevEnvironment, S as ServerHMRConnector, b as build, j as buildErrorMessage, e as createBuilder, z as createFilter, f as createIdResolver, E as createLogger, k as createRunnableDevEnvironment, c as createServer, u as createServerHotChannel, q as createServerModuleRunner, d as defineConfig, n as fetchModule, g as formatPostcssSourceMap, H as isFileLoadingAllowed, G as isFileServingAllowed, m as isRunnableDevEnvironment, l as loadConfigFromFile, I as loadEnv, y as mergeAlias, x as mergeConfig, v as moduleRunnerTransform, w as normalizePath, o as optimizeDeps, h as preprocessCSS, p as preview, r as resolveConfig, J as resolveEnvPrefix, A as rollupVersion, F as searchForWorkspaceRoot, C as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-ChZnDG_O.js';
2
+ import { i as isInNodeModules, a as arraify } from './chunks/dep-Cpgpmu8-.js';
3
+ export { B as BuildEnvironment, D as DevEnvironment, S as ServerHMRConnector, b as build, j as buildErrorMessage, e as createBuilder, z as createFilter, f as createIdResolver, E as createLogger, k as createRunnableDevEnvironment, c as createServer, u as createServerHotChannel, q as createServerModuleRunner, d as defineConfig, n as fetchModule, g as formatPostcssSourceMap, H as isFileLoadingAllowed, G as isFileServingAllowed, m as isRunnableDevEnvironment, l as loadConfigFromFile, I as loadEnv, y as mergeAlias, x as mergeConfig, v as moduleRunnerTransform, w as normalizePath, o as optimizeDeps, h as preprocessCSS, p as preview, r as resolveConfig, J as resolveEnvPrefix, A as rollupVersion, F as searchForWorkspaceRoot, C as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-Cpgpmu8-.js';
4
4
  export { VERSION as version } from './constants.js';
5
5
  export { version as esbuildVersion } from 'esbuild';
6
6
  import 'node:fs';
@@ -10,12 +10,12 @@ import 'node:url';
10
10
  import 'node:util';
11
11
  import 'node:perf_hooks';
12
12
  import 'node:module';
13
- import 'tty';
14
13
  import 'path';
15
14
  import 'fs';
16
15
  import 'node:child_process';
17
16
  import 'node:http';
18
17
  import 'node:https';
18
+ import 'tty';
19
19
  import 'util';
20
20
  import 'net';
21
21
  import 'events';
@@ -29,13 +29,14 @@ import 'node:crypto';
29
29
  import 'node:dns';
30
30
  import 'vite/module-runner';
31
31
  import 'node:readline';
32
+ import 'node:process';
33
+ import 'node:buffer';
32
34
  import 'node:events';
33
35
  import 'crypto';
34
36
  import 'module';
35
37
  import 'node:assert';
36
38
  import 'node:v8';
37
39
  import 'node:worker_threads';
38
- import 'node:buffer';
39
40
  import 'zlib';
40
41
  import 'buffer';
41
42
  import 'https';
@@ -448,7 +448,7 @@ class HMRClient {
448
448
  }
449
449
  // After an HMR update, some modules are no longer imported on the page
450
450
  // but they may have left behind side effects that need to be cleaned up
451
- // (.e.g style injections)
451
+ // (e.g. style injections)
452
452
  async prunePaths(paths) {
453
453
  await Promise.all(
454
454
  paths.map((path) => {
@@ -10,7 +10,7 @@ var require$$0 = require('tty');
10
10
  var require$$1 = require('util');
11
11
  var require$$0$1 = require('path');
12
12
  var require$$0$2 = require('crypto');
13
- var fs$1 = require('fs');
13
+ var require$$1$1 = require('fs');
14
14
  var readline = require('node:readline');
15
15
  var require$$2 = require('os');
16
16
 
@@ -126,10 +126,6 @@ function getDefaultExportFromCjs (x) {
126
126
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
127
127
  }
128
128
 
129
- function commonjsRequire(path) {
130
- throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
131
- }
132
-
133
129
  var picocolors = {exports: {}};
134
130
 
135
131
  var hasRequiredPicocolors;
@@ -137,29 +133,19 @@ var hasRequiredPicocolors;
137
133
  function requirePicocolors () {
138
134
  if (hasRequiredPicocolors) return picocolors.exports;
139
135
  hasRequiredPicocolors = 1;
140
- let argv = process.argv || [],
141
- env = process.env;
136
+ let p = process || {}, argv = p.argv || [], env = p.env || {};
142
137
  let isColorSupported =
143
- !("NO_COLOR" in env || argv.includes("--no-color")) &&
144
- ("FORCE_COLOR" in env ||
145
- argv.includes("--color") ||
146
- process.platform === "win32" ||
147
- (commonjsRequire != null && require$$0.isatty(1) && env.TERM !== "dumb") ||
148
- "CI" in env);
149
-
150
- let formatter =
151
- (open, close, replace = open) =>
138
+ !(!!env.NO_COLOR || argv.includes("--no-color")) &&
139
+ (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || ((p.stdout || {}).isTTY && env.TERM !== "dumb") || !!env.CI);
140
+
141
+ let formatter = (open, close, replace = open) =>
152
142
  input => {
153
- let string = "" + input;
154
- let index = string.indexOf(close, open.length);
155
- return ~index
156
- ? open + replaceClose(string, close, replace, index) + close
157
- : open + string + close
143
+ let string = "" + input, index = string.indexOf(close, open.length);
144
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close
158
145
  };
159
146
 
160
147
  let replaceClose = (string, close, replace, index) => {
161
- let result = "";
162
- let cursor = 0;
148
+ let result = "", cursor = 0;
163
149
  do {
164
150
  result += string.substring(cursor, index) + replace;
165
151
  cursor = index + close.length;
@@ -169,54 +155,54 @@ function requirePicocolors () {
169
155
  };
170
156
 
171
157
  let createColors = (enabled = isColorSupported) => {
172
- let init = enabled ? formatter : () => String;
158
+ let f = enabled ? formatter : () => String;
173
159
  return {
174
160
  isColorSupported: enabled,
175
- reset: init("\x1b[0m", "\x1b[0m"),
176
- bold: init("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
177
- dim: init("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
178
- italic: init("\x1b[3m", "\x1b[23m"),
179
- underline: init("\x1b[4m", "\x1b[24m"),
180
- inverse: init("\x1b[7m", "\x1b[27m"),
181
- hidden: init("\x1b[8m", "\x1b[28m"),
182
- strikethrough: init("\x1b[9m", "\x1b[29m"),
183
-
184
- black: init("\x1b[30m", "\x1b[39m"),
185
- red: init("\x1b[31m", "\x1b[39m"),
186
- green: init("\x1b[32m", "\x1b[39m"),
187
- yellow: init("\x1b[33m", "\x1b[39m"),
188
- blue: init("\x1b[34m", "\x1b[39m"),
189
- magenta: init("\x1b[35m", "\x1b[39m"),
190
- cyan: init("\x1b[36m", "\x1b[39m"),
191
- white: init("\x1b[37m", "\x1b[39m"),
192
- gray: init("\x1b[90m", "\x1b[39m"),
193
-
194
- bgBlack: init("\x1b[40m", "\x1b[49m"),
195
- bgRed: init("\x1b[41m", "\x1b[49m"),
196
- bgGreen: init("\x1b[42m", "\x1b[49m"),
197
- bgYellow: init("\x1b[43m", "\x1b[49m"),
198
- bgBlue: init("\x1b[44m", "\x1b[49m"),
199
- bgMagenta: init("\x1b[45m", "\x1b[49m"),
200
- bgCyan: init("\x1b[46m", "\x1b[49m"),
201
- bgWhite: init("\x1b[47m", "\x1b[49m"),
202
-
203
- blackBright: init("\x1b[90m", "\x1b[39m"),
204
- redBright: init("\x1b[91m", "\x1b[39m"),
205
- greenBright: init("\x1b[92m", "\x1b[39m"),
206
- yellowBright: init("\x1b[93m", "\x1b[39m"),
207
- blueBright: init("\x1b[94m", "\x1b[39m"),
208
- magentaBright: init("\x1b[95m", "\x1b[39m"),
209
- cyanBright: init("\x1b[96m", "\x1b[39m"),
210
- whiteBright: init("\x1b[97m", "\x1b[39m"),
211
-
212
- bgBlackBright: init("\x1b[100m","\x1b[49m"),
213
- bgRedBright: init("\x1b[101m","\x1b[49m"),
214
- bgGreenBright: init("\x1b[102m","\x1b[49m"),
215
- bgYellowBright: init("\x1b[103m","\x1b[49m"),
216
- bgBlueBright: init("\x1b[104m","\x1b[49m"),
217
- bgMagentaBright: init("\x1b[105m","\x1b[49m"),
218
- bgCyanBright: init("\x1b[106m","\x1b[49m"),
219
- bgWhiteBright: init("\x1b[107m","\x1b[49m"),
161
+ reset: f("\x1b[0m", "\x1b[0m"),
162
+ bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
163
+ dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
164
+ italic: f("\x1b[3m", "\x1b[23m"),
165
+ underline: f("\x1b[4m", "\x1b[24m"),
166
+ inverse: f("\x1b[7m", "\x1b[27m"),
167
+ hidden: f("\x1b[8m", "\x1b[28m"),
168
+ strikethrough: f("\x1b[9m", "\x1b[29m"),
169
+
170
+ black: f("\x1b[30m", "\x1b[39m"),
171
+ red: f("\x1b[31m", "\x1b[39m"),
172
+ green: f("\x1b[32m", "\x1b[39m"),
173
+ yellow: f("\x1b[33m", "\x1b[39m"),
174
+ blue: f("\x1b[34m", "\x1b[39m"),
175
+ magenta: f("\x1b[35m", "\x1b[39m"),
176
+ cyan: f("\x1b[36m", "\x1b[39m"),
177
+ white: f("\x1b[37m", "\x1b[39m"),
178
+ gray: f("\x1b[90m", "\x1b[39m"),
179
+
180
+ bgBlack: f("\x1b[40m", "\x1b[49m"),
181
+ bgRed: f("\x1b[41m", "\x1b[49m"),
182
+ bgGreen: f("\x1b[42m", "\x1b[49m"),
183
+ bgYellow: f("\x1b[43m", "\x1b[49m"),
184
+ bgBlue: f("\x1b[44m", "\x1b[49m"),
185
+ bgMagenta: f("\x1b[45m", "\x1b[49m"),
186
+ bgCyan: f("\x1b[46m", "\x1b[49m"),
187
+ bgWhite: f("\x1b[47m", "\x1b[49m"),
188
+
189
+ blackBright: f("\x1b[90m", "\x1b[39m"),
190
+ redBright: f("\x1b[91m", "\x1b[39m"),
191
+ greenBright: f("\x1b[92m", "\x1b[39m"),
192
+ yellowBright: f("\x1b[93m", "\x1b[39m"),
193
+ blueBright: f("\x1b[94m", "\x1b[39m"),
194
+ magentaBright: f("\x1b[95m", "\x1b[39m"),
195
+ cyanBright: f("\x1b[96m", "\x1b[39m"),
196
+ whiteBright: f("\x1b[97m", "\x1b[39m"),
197
+
198
+ bgBlackBright: f("\x1b[100m", "\x1b[49m"),
199
+ bgRedBright: f("\x1b[101m", "\x1b[49m"),
200
+ bgGreenBright: f("\x1b[102m", "\x1b[49m"),
201
+ bgYellowBright: f("\x1b[103m", "\x1b[49m"),
202
+ bgBlueBright: f("\x1b[104m", "\x1b[49m"),
203
+ bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
204
+ bgCyanBright: f("\x1b[106m", "\x1b[49m"),
205
+ bgWhiteBright: f("\x1b[107m", "\x1b[49m"),
220
206
  }
221
207
  };
222
208
 
@@ -4164,7 +4150,7 @@ function requireEtag () {
4164
4150
  */
4165
4151
 
4166
4152
  var crypto = require$$0$2;
4167
- var Stats = fs$1.Stats;
4153
+ var Stats = require$$1$1.Stats;
4168
4154
 
4169
4155
  /**
4170
4156
  * Module variables.
@@ -4642,27 +4628,6 @@ class Mappings {
4642
4628
  let charInHiresBoundary = false;
4643
4629
 
4644
4630
  while (originalCharIndex < chunk.end) {
4645
- if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
4646
- const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
4647
-
4648
- if (this.hires === 'boundary') {
4649
- // in hires "boundary", group segments per word boundary than per char
4650
- if (wordRegex.test(original[originalCharIndex])) {
4651
- // for first char in the boundary found, start the boundary by pushing a segment
4652
- if (!charInHiresBoundary) {
4653
- this.rawSegments.push(segment);
4654
- charInHiresBoundary = true;
4655
- }
4656
- } else {
4657
- // for non-word char, end the boundary by pushing a segment
4658
- this.rawSegments.push(segment);
4659
- charInHiresBoundary = false;
4660
- }
4661
- } else {
4662
- this.rawSegments.push(segment);
4663
- }
4664
- }
4665
-
4666
4631
  if (original[originalCharIndex] === '\n') {
4667
4632
  loc.line += 1;
4668
4633
  loc.column = 0;
@@ -4671,6 +4636,27 @@ class Mappings {
4671
4636
  this.generatedCodeColumn = 0;
4672
4637
  first = true;
4673
4638
  } else {
4639
+ if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
4640
+ const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
4641
+
4642
+ if (this.hires === 'boundary') {
4643
+ // in hires "boundary", group segments per word boundary than per char
4644
+ if (wordRegex.test(original[originalCharIndex])) {
4645
+ // for first char in the boundary found, start the boundary by pushing a segment
4646
+ if (!charInHiresBoundary) {
4647
+ this.rawSegments.push(segment);
4648
+ charInHiresBoundary = true;
4649
+ }
4650
+ } else {
4651
+ // for non-word char, end the boundary by pushing a segment
4652
+ this.rawSegments.push(segment);
4653
+ charInHiresBoundary = false;
4654
+ }
4655
+ } else {
4656
+ this.rawSegments.push(segment);
4657
+ }
4658
+ }
4659
+
4674
4660
  loc.column += 1;
4675
4661
  this.generatedCodeColumn += 1;
4676
4662
  first = false;
@@ -5881,7 +5867,7 @@ var hasRequiredMain$1;
5881
5867
  function requireMain$1 () {
5882
5868
  if (hasRequiredMain$1) return main$2.exports;
5883
5869
  hasRequiredMain$1 = 1;
5884
- const fs = fs$1;
5870
+ const fs = require$$1$1;
5885
5871
  const path = require$$0$1;
5886
5872
  const os = require$$2;
5887
5873
  const crypto = require$$0$2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "6.0.0-beta.3",
3
+ "version": "6.0.0-beta.4",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -81,12 +81,12 @@
81
81
  },
82
82
  "devDependencies": {
83
83
  "@ampproject/remapping": "^2.3.0",
84
- "@babel/parser": "^7.25.7",
84
+ "@babel/parser": "^7.25.8",
85
85
  "@jridgewell/trace-mapping": "^0.3.25",
86
86
  "@polka/compression": "^1.0.0-next.25",
87
87
  "@rollup/plugin-alias": "^5.1.1",
88
- "@rollup/plugin-commonjs": "^28.0.0",
89
- "@rollup/plugin-dynamic-import-vars": "^2.1.3",
88
+ "@rollup/plugin-commonjs": "^28.0.1",
89
+ "@rollup/plugin-dynamic-import-vars": "^2.1.4",
90
90
  "@rollup/plugin-json": "^6.1.0",
91
91
  "@rollup/plugin-node-resolve": "15.3.0",
92
92
  "@rollup/pluginutils": "^5.1.2",
@@ -107,20 +107,19 @@
107
107
  "escape-html": "^1.0.3",
108
108
  "estree-walker": "^3.0.3",
109
109
  "etag": "^1.8.1",
110
- "fast-glob": "^3.3.2",
111
110
  "http-proxy": "^1.18.1",
112
111
  "launch-editor-middleware": "^2.9.1",
113
112
  "lightningcss": "^1.27.0",
114
- "magic-string": "^0.30.11",
113
+ "magic-string": "^0.30.12",
115
114
  "micromatch": "^4.0.8",
116
115
  "mlly": "^1.7.2",
117
116
  "mrmime": "^2.0.0",
118
117
  "nanoid": "^5.0.7",
119
- "open": "^8.4.2",
120
- "parse5": "^7.1.2",
118
+ "open": "^10.1.0",
119
+ "parse5": "^7.2.0",
121
120
  "pathe": "^1.1.2",
122
121
  "periscopic": "^4.0.2",
123
- "picocolors": "^1.1.0",
122
+ "picocolors": "^1.1.1",
124
123
  "picomatch": "^2.3.1",
125
124
  "postcss-import": "^16.1.0",
126
125
  "postcss-load-config": "^4.0.2",
@@ -129,14 +128,15 @@
129
128
  "rollup-plugin-dts": "^6.1.1",
130
129
  "rollup-plugin-esbuild": "^6.1.1",
131
130
  "rollup-plugin-license": "^3.5.3",
132
- "sass": "^1.79.4",
133
- "sass-embedded": "^1.79.4",
134
- "sirv": "^2.0.4",
131
+ "sass": "^1.80.3",
132
+ "sass-embedded": "^1.80.3",
133
+ "sirv": "^3.0.0",
135
134
  "source-map-support": "^0.5.21",
136
135
  "strip-ansi": "^7.1.0",
137
136
  "strip-literal": "^2.1.0",
137
+ "tinyglobby": "^0.2.9",
138
138
  "tsconfck": "^3.1.4",
139
- "tslib": "^2.7.0",
139
+ "tslib": "^2.8.0",
140
140
  "types": "link:./types",
141
141
  "ufo": "^1.5.4",
142
142
  "ws": "^8.18.0"
@@ -149,7 +149,7 @@
149
149
  "sass-embedded": "*",
150
150
  "stylus": "*",
151
151
  "sugarss": "*",
152
- "terser": "^5.4.0"
152
+ "terser": "^5.16.0"
153
153
  },
154
154
  "peerDependenciesMeta": {
155
155
  "@types/node": {