vite 5.3.3 → 5.3.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,4 +1,4 @@
1
- import { C as commonjsGlobal, B as getDefaultExportFromCjs } from './dep-CzJTQ5q7.js';
1
+ import { C as commonjsGlobal, B as getDefaultExportFromCjs } from './dep-D8YhmIY-.js';
2
2
  import require$$0__default from 'fs';
3
3
  import require$$0 from 'postcss';
4
4
  import require$$0$1 from 'path';
@@ -1,4 +1,4 @@
1
- import { B as getDefaultExportFromCjs } from './dep-CzJTQ5q7.js';
1
+ import { B as getDefaultExportFromCjs } from './dep-D8YhmIY-.js';
2
2
  import require$$0 from 'path';
3
3
  import require$$0__default from 'fs';
4
4
  import { l as lib } from './dep-IQS-Za7F.js';
@@ -36034,8 +36034,10 @@ function cssPostPlugin(config) {
36034
36034
  source: content
36035
36035
  });
36036
36036
  generatedAssets.get(config).set(referenceId, { originalName: originalFilename });
36037
+ const filename = this.getFileName(referenceId);
36038
+ chunk.viteMetadata.importedAssets.add(cleanUrl(filename));
36037
36039
  const replacement = toOutputFilePathInJS(
36038
- this.getFileName(referenceId),
36040
+ filename,
36039
36041
  "asset",
36040
36042
  chunk.fileName,
36041
36043
  "js",
@@ -36576,8 +36578,8 @@ function createCachedImport(imp) {
36576
36578
  return cached;
36577
36579
  };
36578
36580
  }
36579
- const importPostcssImport = createCachedImport(() => import('./dep-DL1Zl8zp.js').then(function (n) { return n.i; }));
36580
- const importPostcssModules = createCachedImport(() => import('./dep-DDAZqU2f.js').then(function (n) { return n.i; }));
36581
+ const importPostcssImport = createCachedImport(() => import('./dep-CMeK12d_.js').then(function (n) { return n.i; }));
36582
+ const importPostcssModules = createCachedImport(() => import('./dep-CCo80PNg.js').then(function (n) { return n.i; }));
36581
36583
  const importPostcss = createCachedImport(() => import('postcss'));
36582
36584
  const preprocessorWorkerControllerCache = /* @__PURE__ */ new WeakMap();
36583
36585
  let alwaysFakeWorkerWorkerControllerCache;
@@ -48309,18 +48311,18 @@ function webWorkerPlugin(config) {
48309
48311
  // Using blob URL for SharedWorker results in multiple instances of a same worker
48310
48312
  workerConstructor === "Worker" ? `${encodedJs}
48311
48313
  const decodeBase64 = (base64) => Uint8Array.from(atob(base64), c => c.charCodeAt(0));
48312
- const blob = typeof window !== "undefined" && window.Blob && new Blob([${workerType === "classic" ? "" : (
48314
+ const blob = typeof self !== "undefined" && self.Blob && new Blob([${workerType === "classic" ? "" : (
48313
48315
  // `URL` is always available, in `Worker[type="module"]`
48314
48316
  `'URL.revokeObjectURL(import.meta.url);',`
48315
48317
  )}decodeBase64(encodedJs)], { type: "text/javascript;charset=utf-8" });
48316
48318
  export default function WorkerWrapper(options) {
48317
48319
  let objURL;
48318
48320
  try {
48319
- objURL = blob && (window.URL || window.webkitURL).createObjectURL(blob);
48321
+ objURL = blob && (self.URL || self.webkitURL).createObjectURL(blob);
48320
48322
  if (!objURL) throw ''
48321
48323
  const worker = new ${workerConstructor}(objURL, ${workerTypeOption});
48322
48324
  worker.addEventListener("error", () => {
48323
- (window.URL || window.webkitURL).revokeObjectURL(objURL);
48325
+ (self.URL || self.webkitURL).revokeObjectURL(objURL);
48324
48326
  });
48325
48327
  return worker;
48326
48328
  } catch(e) {
@@ -48331,7 +48333,7 @@ function webWorkerPlugin(config) {
48331
48333
  }${// For module workers, we should not revoke the URL until the worker runs,
48332
48334
  // otherwise the worker fails to run
48333
48335
  workerType === "classic" ? ` finally {
48334
- objURL && (window.URL || window.webkitURL).revokeObjectURL(objURL);
48336
+ objURL && (self.URL || self.webkitURL).revokeObjectURL(objURL);
48335
48337
  }` : ""}
48336
48338
  }` : `${encodedJs}
48337
48339
  export default function WorkerWrapper(options) {
@@ -48566,7 +48568,7 @@ function getWorkerType(raw, clean, i) {
48566
48568
  return "classic";
48567
48569
  }
48568
48570
  const workerOpts = parseWorkerOptions(workerOptString, commaIndex + 1);
48569
- if (workerOpts.type && ["classic", "module"].includes(workerOpts.type)) {
48571
+ if (workerOpts.type && (workerOpts.type === "module" || workerOpts.type === "classic")) {
48570
48572
  return workerOpts.type;
48571
48573
  }
48572
48574
  return "classic";
@@ -64808,7 +64810,7 @@ const preloadMarker = `__VITE_PRELOAD__`;
64808
64810
  const preloadHelperId = "\0vite/preload-helper.js";
64809
64811
  const preloadMarkerRE = new RegExp(preloadMarker, "g");
64810
64812
  const dynamicImportPrefixRE = /import\s*\(/;
64811
- const dynamicImportTreeshakenRE = /((?:\bconst\s+|\blet\s+|\bvar\s+|,\s*)(\{[^}.=]+\})\s*=\s*await\s+import\([^)]+\))|(\(\s*await\s+import\([^)]+\)\s*\)(\??\.[\w$]+))|\bimport\([^)]+\)(\s*\.then\(\s*(?:function\s*)?\(\s*\{([^}.=]+)\}\))/g;
64813
+ const dynamicImportTreeshakenRE = /((?:\bconst\s+|\blet\s+|\bvar\s+|,\s*)(\{[^{}.=]+\})\s*=\s*await\s+import\([^)]+\))|(\(\s*await\s+import\([^)]+\)\s*\)(\??\.[\w$]+))|\bimport\([^)]+\)(\s*\.then\(\s*(?:function\s*)?\(\s*\{([^{}.=]+)\}\))/g;
64812
64814
  function toRelativePath(filename, importer) {
64813
64815
  const relPath = path$m.posix.relative(path$m.posix.dirname(importer), filename);
64814
64816
  return relPath[0] === "." ? relPath : `./${relPath}`;
@@ -65844,7 +65846,7 @@ function resolveBuildOutputs(outputs, libOptions, logger) {
65844
65846
  );
65845
65847
  }
65846
65848
  outputs.forEach((output) => {
65847
- if (["umd", "iife"].includes(output.format) && !output.name) {
65849
+ if ((output.format === "umd" || output.format === "iife") && !output.name) {
65848
65850
  throw new Error(
65849
65851
  'Entries in "build.rollupOptions.output" must specify "name" when the format is "umd" or "iife".'
65850
65852
  );
package/dist/node/cli.js CHANGED
@@ -2,7 +2,7 @@ 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 { A as colors, v as createLogger, r as resolveConfig } from './chunks/dep-CzJTQ5q7.js';
5
+ import { A as colors, v as createLogger, r as resolveConfig } from './chunks/dep-D8YhmIY-.js';
6
6
  import { VERSION } from './constants.js';
7
7
  import 'node:fs/promises';
8
8
  import 'node:url';
@@ -730,7 +730,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
730
730
  `[boolean] force the optimizer to ignore the cache and re-bundle`
731
731
  ).action(async (root, options) => {
732
732
  filterDuplicateOptions(options);
733
- const { createServer } = await import('./chunks/dep-CzJTQ5q7.js').then(function (n) { return n.E; });
733
+ const { createServer } = await import('./chunks/dep-D8YhmIY-.js').then(function (n) { return n.E; });
734
734
  try {
735
735
  const server = await createServer({
736
736
  root,
@@ -822,7 +822,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
822
822
  `[boolean] force empty outDir when it's outside of root`
823
823
  ).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).action(async (root, options) => {
824
824
  filterDuplicateOptions(options);
825
- const { build } = await import('./chunks/dep-CzJTQ5q7.js').then(function (n) { return n.F; });
825
+ const { build } = await import('./chunks/dep-D8YhmIY-.js').then(function (n) { return n.F; });
826
826
  const buildOptions = cleanOptions(options);
827
827
  try {
828
828
  await build({
@@ -851,7 +851,7 @@ cli.command("optimize [root]", "pre-bundle dependencies").option(
851
851
  ).action(
852
852
  async (root, options) => {
853
853
  filterDuplicateOptions(options);
854
- const { optimizeDeps } = await import('./chunks/dep-CzJTQ5q7.js').then(function (n) { return n.D; });
854
+ const { optimizeDeps } = await import('./chunks/dep-D8YhmIY-.js').then(function (n) { return n.D; });
855
855
  try {
856
856
  const config = await resolveConfig(
857
857
  {
@@ -877,7 +877,7 @@ ${e.stack}`),
877
877
  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(
878
878
  async (root, options) => {
879
879
  filterDuplicateOptions(options);
880
- const { preview } = await import('./chunks/dep-CzJTQ5q7.js').then(function (n) { return n.G; });
880
+ const { preview } = await import('./chunks/dep-D8YhmIY-.js').then(function (n) { return n.G; });
881
881
  try {
882
882
  const server = await preview({
883
883
  root,
@@ -414,6 +414,7 @@ declare namespace HttpProxy {
414
414
  * @param req - Client request.
415
415
  * @param res - Client response.
416
416
  * @param options - Additional options.
417
+ * @param callback - Error callback.
417
418
  */
418
419
  web(
419
420
  req: http.IncomingMessage,
@@ -428,6 +429,7 @@ declare namespace HttpProxy {
428
429
  * @param socket - Client socket.
429
430
  * @param head - Client head.
430
431
  * @param options - Additional options.
432
+ * @param callback - Error callback.
431
433
  */
432
434
  ws(
433
435
  req: http.IncomingMessage,
@@ -2096,6 +2098,9 @@ interface RollupDynamicImportVarsOptions {
2096
2098
  declare namespace Terser {
2097
2099
  export type ECMA = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020
2098
2100
 
2101
+ export type ConsoleProperty = keyof typeof console
2102
+ type DropConsoleOption = boolean | ConsoleProperty[]
2103
+
2099
2104
  export interface ParseOptions {
2100
2105
  bare_returns?: boolean
2101
2106
  /** @deprecated legacy option. Currently, all supported EcmaScript is valid to parse. */
@@ -2116,7 +2121,7 @@ declare namespace Terser {
2116
2121
  dead_code?: boolean
2117
2122
  defaults?: boolean
2118
2123
  directives?: boolean
2119
- drop_console?: boolean
2124
+ drop_console?: DropConsoleOption
2120
2125
  drop_debugger?: boolean
2121
2126
  ecma?: ECMA
2122
2127
  evaluate?: boolean
@@ -2139,6 +2144,7 @@ declare namespace Terser {
2139
2144
  passes?: number
2140
2145
  properties?: boolean
2141
2146
  pure_funcs?: string[]
2147
+ pure_new?: boolean
2142
2148
  pure_getters?: boolean | 'strict'
2143
2149
  reduce_funcs?: boolean
2144
2150
  reduce_vars?: boolean
@@ -2188,7 +2194,7 @@ declare namespace Terser {
2188
2194
  * Obtains the nth most favored (usually shortest) identifier to rename a variable to.
2189
2195
  * The mangler will increment n and retry until the return value is not in use in scope, and is not a reserved word.
2190
2196
  * This function is expected to be stable; Evaluating get(n) === get(n) should always return true.
2191
- * @param n - The ordinal of the identifier.
2197
+ * @param n The ordinal of the identifier.
2192
2198
  */
2193
2199
  get(n: number): string
2194
2200
  }
@@ -2200,8 +2206,8 @@ declare namespace Terser {
2200
2206
  /**
2201
2207
  * Modifies the internal weighting of the input characters by the specified delta.
2202
2208
  * Will be invoked on the entire printed AST, and then deduct mangleable identifiers.
2203
- * @param chars - The characters to modify the weighting of.
2204
- * @param delta - The numeric weight to add to the characters.
2209
+ * @param chars The characters to modify the weighting of.
2210
+ * @param delta The numeric weight to add to the characters.
2205
2211
  */
2206
2212
  consider(chars: string, delta: number): number
2207
2213
  /**
@@ -2284,7 +2290,7 @@ declare namespace Terser {
2284
2290
  module?: boolean
2285
2291
  nameCache?: object
2286
2292
  format?: FormatOptions
2287
- /** @deprecated deprecated */
2293
+ /** @deprecated */
2288
2294
  output?: FormatOptions
2289
2295
  parse?: ParseOptions
2290
2296
  safari10?: boolean
@@ -2304,6 +2310,7 @@ declare namespace Terser {
2304
2310
  includeSources?: boolean
2305
2311
  filename?: string
2306
2312
  root?: string
2313
+ asObject?: boolean
2307
2314
  url?: string | 'inline'
2308
2315
  }
2309
2316
  }
@@ -1,6 +1,6 @@
1
1
  export { parseAst, parseAstAsync } from 'rollup/parseAst';
2
- import { i as isInNodeModules, a as arraify } from './chunks/dep-CzJTQ5q7.js';
3
- export { b as build, g as buildErrorMessage, k as createFilter, v as createLogger, c as createServer, d as defineConfig, h as fetchModule, f as formatPostcssSourceMap, x as isFileServingAllowed, l as loadConfigFromFile, y as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, z as resolveEnvPrefix, q as rollupVersion, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-CzJTQ5q7.js';
2
+ import { i as isInNodeModules, a as arraify } from './chunks/dep-D8YhmIY-.js';
3
+ export { b as build, g as buildErrorMessage, k as createFilter, v as createLogger, c as createServer, d as defineConfig, h as fetchModule, f as formatPostcssSourceMap, x as isFileServingAllowed, l as loadConfigFromFile, y as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, z as resolveEnvPrefix, q as rollupVersion, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-D8YhmIY-.js';
4
4
  export { VERSION as version } from './constants.js';
5
5
  export { version as esbuildVersion } from 'esbuild';
6
6
  import { existsSync, readFileSync } from 'node:fs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "5.3.3",
3
+ "version": "5.3.4",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",