vite 7.0.0-beta.2 → 7.0.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.
@@ -2,8 +2,8 @@ import { createRequire as ___createRequire } from 'module'; const require = ___c
2
2
  import { __commonJS } from "./dep-Drtntmtt.js";
3
3
  import { require_lib } from "./dep-DmY5m86w.js";
4
4
 
5
- //#region ../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/lib/format-import-prelude.js
6
- var require_format_import_prelude = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/lib/format-import-prelude.js"(exports, module) {
5
+ //#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/format-import-prelude.js
6
+ var require_format_import_prelude = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/format-import-prelude.js"(exports, module) {
7
7
  module.exports = function formatImportPrelude$2(layer, media, supports) {
8
8
  const parts = [];
9
9
  if (typeof layer !== "undefined") {
@@ -18,10 +18,11 @@ var require_format_import_prelude = __commonJS({ "../../node_modules/.pnpm/postc
18
18
  } });
19
19
 
20
20
  //#endregion
21
- //#region ../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/lib/base64-encoded-import.js
22
- var require_base64_encoded_import = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/lib/base64-encoded-import.js"(exports, module) {
21
+ //#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/base64-encoded-import.js
22
+ var require_base64_encoded_import = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/base64-encoded-import.js"(exports, module) {
23
23
  const formatImportPrelude$1 = require_format_import_prelude();
24
24
  module.exports = function base64EncodedConditionalImport$1(prelude, conditions) {
25
+ if (!conditions?.length) return prelude;
25
26
  conditions.reverse();
26
27
  const first = conditions.pop();
27
28
  let params = `${prelude} ${formatImportPrelude$1(first.layer, first.media, first.supports)}`;
@@ -31,18 +32,36 @@ var require_base64_encoded_import = __commonJS({ "../../node_modules/.pnpm/postc
31
32
  } });
32
33
 
33
34
  //#endregion
34
- //#region ../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/lib/apply-conditions.js
35
- var require_apply_conditions = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/lib/apply-conditions.js"(exports, module) {
35
+ //#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/apply-conditions.js
36
+ var require_apply_conditions = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/apply-conditions.js"(exports, module) {
36
37
  const base64EncodedConditionalImport = require_base64_encoded_import();
37
38
  module.exports = function applyConditions$1(bundle, atRule) {
38
- bundle.forEach((stmt) => {
39
- if (stmt.type === "charset" || stmt.type === "warning" || !stmt.conditions?.length) return;
39
+ const firstImportStatementIndex = bundle.findIndex((stmt) => stmt.type === "import");
40
+ const lastImportStatementIndex = bundle.findLastIndex((stmt) => stmt.type === "import");
41
+ bundle.forEach((stmt, index) => {
42
+ if (stmt.type === "charset" || stmt.type === "warning") return;
43
+ if (stmt.type === "layer" && (index < lastImportStatementIndex && stmt.conditions?.length || index > firstImportStatementIndex && index < lastImportStatementIndex)) {
44
+ stmt.type = "import";
45
+ stmt.node = stmt.node.clone({
46
+ name: "import",
47
+ params: base64EncodedConditionalImport(`'data:text/css;base64,${Buffer.from(stmt.node.toString()).toString("base64")}'`, stmt.conditions)
48
+ });
49
+ return;
50
+ }
51
+ if (!stmt.conditions?.length) return;
40
52
  if (stmt.type === "import") {
41
53
  stmt.node.params = base64EncodedConditionalImport(stmt.fullUri, stmt.conditions);
42
54
  return;
43
55
  }
44
- const { nodes } = stmt;
45
- const { parent } = nodes[0];
56
+ let nodes;
57
+ let parent;
58
+ if (stmt.type === "layer") {
59
+ nodes = [stmt.node];
60
+ parent = stmt.node.parent;
61
+ } else {
62
+ nodes = stmt.nodes;
63
+ parent = nodes[0].parent;
64
+ }
46
65
  const atRules = [];
47
66
  for (const condition of stmt.conditions) {
48
67
  if (typeof condition.media !== "undefined") {
@@ -89,8 +108,8 @@ var require_apply_conditions = __commonJS({ "../../node_modules/.pnpm/postcss-im
89
108
  } });
90
109
 
91
110
  //#endregion
92
- //#region ../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/lib/apply-raws.js
93
- var require_apply_raws = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/lib/apply-raws.js"(exports, module) {
111
+ //#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/apply-raws.js
112
+ var require_apply_raws = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/apply-raws.js"(exports, module) {
94
113
  module.exports = function applyRaws$1(bundle) {
95
114
  bundle.forEach((stmt, index) => {
96
115
  if (index === 0) return;
@@ -104,12 +123,16 @@ var require_apply_raws = __commonJS({ "../../node_modules/.pnpm/postcss-import@1
104
123
  } });
105
124
 
106
125
  //#endregion
107
- //#region ../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/lib/apply-styles.js
108
- var require_apply_styles = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/lib/apply-styles.js"(exports, module) {
126
+ //#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/apply-styles.js
127
+ var require_apply_styles = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/apply-styles.js"(exports, module) {
109
128
  module.exports = function applyStyles$1(bundle, styles) {
110
129
  styles.nodes = [];
111
130
  bundle.forEach((stmt) => {
112
- if (["charset", "import"].includes(stmt.type)) {
131
+ if ([
132
+ "charset",
133
+ "import",
134
+ "layer"
135
+ ].includes(stmt.type)) {
113
136
  stmt.node.parent = void 0;
114
137
  styles.append(stmt.node);
115
138
  } else if (stmt.type === "nodes") stmt.nodes.forEach((node) => {
@@ -121,8 +144,8 @@ var require_apply_styles = __commonJS({ "../../node_modules/.pnpm/postcss-import
121
144
  } });
122
145
 
123
146
  //#endregion
124
- //#region ../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/lib/data-url.js
125
- var require_data_url = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/lib/data-url.js"(exports, module) {
147
+ //#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/data-url.js
148
+ var require_data_url = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/data-url.js"(exports, module) {
126
149
  const anyDataURLRegexp = /^data:text\/css(?:;(base64|plain))?,/i;
127
150
  const base64DataURLRegexp = /^data:text\/css;base64,/i;
128
151
  const plainDataURLRegexp = /^data:text\/css;plain,/i;
@@ -141,19 +164,21 @@ var require_data_url = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.
141
164
  } });
142
165
 
143
166
  //#endregion
144
- //#region ../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/lib/parse-statements.js
145
- var require_parse_statements = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/lib/parse-statements.js"(exports, module) {
167
+ //#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/parse-statements.js
168
+ var require_parse_statements = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/parse-statements.js"(exports, module) {
146
169
  const valueParser = require_lib();
147
170
  const { stringify } = valueParser;
148
171
  module.exports = function parseStatements$1(result, styles, conditions, from) {
149
172
  const statements = [];
150
173
  let nodes = [];
174
+ let encounteredNonImportNodes = false;
151
175
  styles.each((node) => {
152
176
  let stmt;
153
177
  if (node.type === "atrule") {
154
178
  if (node.name === "import") stmt = parseImport(result, node, conditions, from);
155
179
  else if (node.name === "charset") stmt = parseCharset(result, node, conditions, from);
156
- }
180
+ else if (node.name === "layer" && !encounteredNonImportNodes && !node.nodes) stmt = parseLayer(result, node, conditions, from);
181
+ } else if (node.type !== "comment") encounteredNonImportNodes = true;
157
182
  if (stmt) {
158
183
  if (nodes.length) {
159
184
  statements.push({
@@ -254,11 +279,19 @@ var require_parse_statements = __commonJS({ "../../node_modules/.pnpm/postcss-im
254
279
  });
255
280
  return stmt;
256
281
  }
282
+ function parseLayer(result, atRule, conditions, from) {
283
+ return {
284
+ type: "layer",
285
+ node: atRule,
286
+ conditions: [...conditions],
287
+ from
288
+ };
289
+ }
257
290
  } });
258
291
 
259
292
  //#endregion
260
- //#region ../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/lib/process-content.js
261
- var require_process_content = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/lib/process-content.js"(exports, module) {
293
+ //#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/process-content.js
294
+ var require_process_content = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/process-content.js"(exports, module) {
262
295
  const path$2 = require("path");
263
296
  let sugarss;
264
297
  module.exports = function processContent$1(result, content, filename, options, postcss) {
@@ -292,8 +325,8 @@ var require_process_content = __commonJS({ "../../node_modules/.pnpm/postcss-imp
292
325
  } });
293
326
 
294
327
  //#endregion
295
- //#region ../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/lib/parse-styles.js
296
- var require_parse_styles = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/lib/parse-styles.js"(exports, module) {
328
+ //#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/parse-styles.js
329
+ var require_parse_styles = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/parse-styles.js"(exports, module) {
297
330
  const path$1 = require("path");
298
331
  const dataURL = require_data_url();
299
332
  const parseStatements = require_parse_statements();
@@ -308,7 +341,7 @@ var require_parse_styles = __commonJS({ "../../node_modules/.pnpm/postcss-import
308
341
  await resolveImportId(result, stmt, options, state, postcss);
309
342
  }
310
343
  let charset;
311
- const imports = [];
344
+ const beforeBundle = [];
312
345
  const bundle = [];
313
346
  function handleCharset(stmt) {
314
347
  if (!charset) charset = stmt;
@@ -319,15 +352,17 @@ var require_parse_styles = __commonJS({ "../../node_modules/.pnpm/postcss-import
319
352
  statements.forEach((stmt) => {
320
353
  if (stmt.type === "charset") handleCharset(stmt);
321
354
  else if (stmt.type === "import") if (stmt.children) stmt.children.forEach((child, index) => {
322
- if (child.type === "import") imports.push(child);
355
+ if (child.type === "import") beforeBundle.push(child);
356
+ else if (child.type === "layer") beforeBundle.push(child);
323
357
  else if (child.type === "charset") handleCharset(child);
324
358
  else bundle.push(child);
325
359
  if (index === 0) child.parent = stmt;
326
360
  });
327
- else imports.push(stmt);
361
+ else beforeBundle.push(stmt);
362
+ else if (stmt.type === "layer") beforeBundle.push(stmt);
328
363
  else if (stmt.type === "nodes") bundle.push(stmt);
329
364
  });
330
- return charset ? [charset, ...imports.concat(bundle)] : imports.concat(bundle);
365
+ return charset ? [charset, ...beforeBundle.concat(bundle)] : beforeBundle.concat(bundle);
331
366
  }
332
367
  async function resolveImportId(result, stmt, options, state, postcss) {
333
368
  if (dataURL.isValid(stmt.uri)) {
@@ -397,8 +432,8 @@ var require_parse_styles = __commonJS({ "../../node_modules/.pnpm/postcss-import
397
432
  } });
398
433
 
399
434
  //#endregion
400
- //#region ../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/index.js
401
- var require_postcss_import = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.0_postcss@8.5.5/node_modules/postcss-import/index.js"(exports, module) {
435
+ //#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/index.js
436
+ var require_postcss_import = __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/index.js"(exports, module) {
402
437
  const path = require("path");
403
438
  const applyConditions = require_apply_conditions();
404
439
  const applyRaws = require_apply_raws();
@@ -1,5 +1,5 @@
1
1
  import { createRequire as ___createRequire } from 'module'; const require = ___createRequire(import.meta.url);
2
- import { addManuallyIncludedOptimizeDeps, addOptimizedDepInfo, cleanupDepsCacheStaleDirs, createIsOptimizedDepFile, createIsOptimizedDepUrl, depsFromOptimizedDepInfo, depsLogString, discoverProjectDependencies, extractExportsData, getDepsCacheDir, getOptimizedDepPath, initDepsOptimizerMetadata, isDepOptimizationDisabled, loadCachedDepOptimizationMetadata, optimizeDeps, optimizeExplicitEnvironmentDeps, optimizedDepInfoFromFile, optimizedDepInfoFromId, optimizedDepNeedsInterop, runOptimizeDeps, toDiscoveredDependencies } from "./dep-Bkc4tc5S.js";
2
+ import { addManuallyIncludedOptimizeDeps, addOptimizedDepInfo, cleanupDepsCacheStaleDirs, createIsOptimizedDepFile, createIsOptimizedDepUrl, depsFromOptimizedDepInfo, depsLogString, discoverProjectDependencies, extractExportsData, getDepsCacheDir, getOptimizedDepPath, initDepsOptimizerMetadata, isDepOptimizationDisabled, loadCachedDepOptimizationMetadata, optimizeDeps, optimizeExplicitEnvironmentDeps, optimizedDepInfoFromFile, optimizedDepInfoFromId, optimizedDepNeedsInterop, runOptimizeDeps, toDiscoveredDependencies } from "./dep-DJGyAxkV.js";
3
3
  import "./dep-Ctugieod.js";
4
4
 
5
5
  export { optimizeDeps };
package/dist/node/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createRequire as ___createRequire } from 'module'; const require = ___createRequire(import.meta.url);
2
2
  import { __toESM } from "./chunks/dep-Drtntmtt.js";
3
- import { createLogger, require_picocolors, resolveConfig } from "./chunks/dep-Bkc4tc5S.js";
3
+ import { createLogger, require_picocolors, resolveConfig } from "./chunks/dep-DJGyAxkV.js";
4
4
  import { VERSION } from "./chunks/dep-Ctugieod.js";
5
5
  import fs from "node:fs";
6
6
  import path from "node:path";
@@ -568,7 +568,7 @@ const convertBase = (v) => {
568
568
  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 esbuild, 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`);
569
569
  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`).action(async (root, options) => {
570
570
  filterDuplicateOptions(options);
571
- const { createServer } = await import("./chunks/dep-CZ6VYVb7.js");
571
+ const { createServer } = await import("./chunks/dep-BVsfzsUS.js");
572
572
  try {
573
573
  const server = await createServer({
574
574
  root,
@@ -624,7 +624,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
624
624
  });
625
625
  cli.command("build [root]", "build for production").option("--target <target>", `[string] transpile target (default: 'baseline-widely-available')`).option("--outDir <dir>", `[string] output directory (default: dist)`).option("--assetsDir <dir>", `[string] directory under outDir to place assets in (default: assets)`).option("--assetsInlineLimit <number>", `[number] static asset base64 inline threshold in bytes (default: 4096)`).option("--ssr [entry]", `[string] build specified entry for server-side rendering`).option("--sourcemap [output]", `[boolean | "inline" | "hidden"] output source maps for build (default: false)`).option("--minify [minifier]", "[boolean | \"terser\" | \"esbuild\"] enable/disable minification, or specify minifier to use (default: esbuild)").option("--manifest [name]", `[boolean | string] emit build manifest json`).option("--ssrManifest [name]", `[boolean | string] emit ssr manifest json`).option("--emptyOutDir", `[boolean] force empty outDir when it's outside of root`).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as \`builder: {}\``).action(async (root, options) => {
626
626
  filterDuplicateOptions(options);
627
- const { createBuilder } = await import("./chunks/dep-DZ1Lk4oF.js");
627
+ const { createBuilder } = await import("./chunks/dep-BTLup-s1.js");
628
628
  const buildOptions = cleanGlobalCLIOptions(cleanBuilderCLIOptions(options));
629
629
  try {
630
630
  const inlineConfig = {
@@ -649,7 +649,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
649
649
  });
650
650
  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) => {
651
651
  filterDuplicateOptions(options);
652
- const { optimizeDeps } = await import("./chunks/dep-C5h9brB_.js");
652
+ const { optimizeDeps } = await import("./chunks/dep-fMAWSKNW.js");
653
653
  try {
654
654
  const config = await resolveConfig({
655
655
  root,
@@ -667,7 +667,7 @@ cli.command("optimize [root]", "pre-bundle dependencies (deprecated, the pre-bun
667
667
  });
668
668
  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) => {
669
669
  filterDuplicateOptions(options);
670
- const { preview } = await import("./chunks/dep-B_m28uIY.js");
670
+ const { preview } = await import("./chunks/dep-BQABeiGC.js");
671
671
  try {
672
672
  const server = await preview({
673
673
  root,
@@ -5,9 +5,6 @@ import { CustomEventMap, InferCustomEventPayload, InferCustomEventPayload as hmr
5
5
  import * as Rollup from "rollup";
6
6
  import { CustomPluginOptions, ExistingRawSourceMap, InputOption, InputOptions, LoadResult, MinimalPluginContext, ModuleFormat, ModuleInfo, ObjectHook, OutputBundle, OutputChunk, PartialResolvedId, PluginContext, PluginContextMeta, PluginHooks, ResolveIdResult, RollupError, RollupLog, RollupOptions, RollupOutput, RollupWatcher, SourceDescription, SourceMap, SourceMapInput, TransformPluginContext, WatcherOptions } from "rollup";
7
7
  import { parseAst, parseAstAsync } from "rollup/parseAst";
8
- import * as http_3 from "node:http";
9
- import * as http_2 from "node:http";
10
- import * as http_1 from "node:http";
11
8
  import * as http from "node:http";
12
9
  import { Agent, ClientRequest, ClientRequestArgs, OutgoingHttpHeaders, ServerResponse } from "node:http";
13
10
  import { Http2SecureServer } from "node:http2";
@@ -24,6 +21,7 @@ import { FetchFunction, FetchFunctionOptions, FetchResult, FetchResult as module
24
21
  import { BuildOptions as esbuild_BuildOptions, TransformOptions as EsbuildTransformOptions, TransformOptions as esbuild_TransformOptions, TransformResult as esbuild_TransformResult, version as esbuildVersion } from "esbuild";
25
22
  import { SecureContextOptions } from "node:tls";
26
23
  import { ZlibOptions } from "node:zlib";
24
+ import { Terser, TerserMinifyOptions } from "../../types/internal/terserOptions.js";
27
25
  import * as PostCSS from "postcss";
28
26
  import { LightningCSSOptions, LightningCSSOptions as lightningcssOptions_LightningCSSOptions } from "../../types/internal/lightningcssOptions.js";
29
27
  import { LessPreprocessorBaseOptions, SassModernPreprocessBaseOptions, StylusPreprocessorBaseOptions } from "../../types/internal/cssPreprocessorOptions.js";
@@ -31,6 +29,7 @@ import { GeneralImportGlobOptions, ImportGlobFunction, ImportGlobOptions, KnownA
31
29
  import { ChunkMetadata, CustomPluginOptionsVite } from "../../types/metadata.js";
32
30
 
33
31
  //#region src/types/alias.d.ts
32
+
34
33
  interface Alias {
35
34
  find: string | RegExp;
36
35
  replacement: string;
@@ -255,21 +254,21 @@ interface AwaitWriteFinishOptions {
255
254
  //#endregion
256
255
  //#region src/types/connect.d.ts
257
256
  declare namespace Connect {
258
- export type ServerHandle = HandleFunction | http_3.Server;
259
- export class IncomingMessage extends http_3.IncomingMessage {
260
- originalUrl?: http_3.IncomingMessage['url'] | undefined;
257
+ export type ServerHandle = HandleFunction | http.Server;
258
+ export class IncomingMessage extends http.IncomingMessage {
259
+ originalUrl?: http.IncomingMessage['url'] | undefined;
261
260
  }
262
261
  export type NextFunction = (err?: any) => void;
263
- export type SimpleHandleFunction = (req: IncomingMessage, res: http_3.ServerResponse) => void;
264
- export type NextHandleFunction = (req: IncomingMessage, res: http_3.ServerResponse, next: NextFunction) => void;
265
- export type ErrorHandleFunction = (err: any, req: IncomingMessage, res: http_3.ServerResponse, next: NextFunction) => void;
262
+ export type SimpleHandleFunction = (req: IncomingMessage, res: http.ServerResponse) => void;
263
+ export type NextHandleFunction = (req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void;
264
+ export type ErrorHandleFunction = (err: any, req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void;
266
265
  export type HandleFunction = SimpleHandleFunction | NextHandleFunction | ErrorHandleFunction;
267
266
  export interface ServerStackItem {
268
267
  route: string;
269
268
  handle: ServerHandle;
270
269
  }
271
270
  export interface Server extends NodeJS.EventEmitter {
272
- (req: http_3.IncomingMessage, res: http_3.ServerResponse, next?: Function): void;
271
+ (req: http.IncomingMessage, res: http.ServerResponse, next?: Function): void;
273
272
  route: string;
274
273
  stack: ServerStackItem[];
275
274
 
@@ -293,7 +292,7 @@ declare namespace Connect {
293
292
  * Handle server requests, punting them down
294
293
  * the middleware stack.
295
294
  */
296
- handle(req: http_3.IncomingMessage, res: http_3.ServerResponse, next: Function): void;
295
+ handle(req: http.IncomingMessage, res: http.ServerResponse, next: Function): void;
297
296
 
298
297
  /**
299
298
  * Listen for connections.
@@ -317,10 +316,10 @@ declare namespace Connect {
317
316
  * http.createServer(app).listen(80);
318
317
  * https.createServer(options, app).listen(443);
319
318
  */
320
- listen(port: number, hostname?: string, backlog?: number, callback?: Function): http_3.Server;
321
- listen(port: number, hostname?: string, callback?: Function): http_3.Server;
322
- listen(path: string, callback?: Function): http_3.Server;
323
- listen(handle: any, listeningListener?: Function): http_3.Server;
319
+ listen(port: number, hostname?: string, backlog?: number, callback?: Function): http.Server;
320
+ listen(port: number, hostname?: string, callback?: Function): http.Server;
321
+ listen(path: string, callback?: Function): http.Server;
322
+ listen(handle: any, listeningListener?: Function): http.Server;
324
323
  }
325
324
  }
326
325
  //#endregion
@@ -342,7 +341,7 @@ declare namespace HttpProxy {
342
341
  ciphers?: string | undefined;
343
342
  secureProtocol?: string | undefined;
344
343
  }
345
- export type ErrorCallback = (err: Error, req: http_2.IncomingMessage, res: http_2.ServerResponse, target?: ProxyTargetUrl) => void;
344
+ export type ErrorCallback = (err: Error, req: http.IncomingMessage, res: http.ServerResponse, target?: ProxyTargetUrl) => void;
346
345
  export class Server extends events.EventEmitter {
347
346
  /**
348
347
  * Creates the proxy server with specified options.
@@ -357,7 +356,7 @@ declare namespace HttpProxy {
357
356
  * @param options - Additional options.
358
357
  * @param callback - Error callback.
359
358
  */
360
- web(req: http_2.IncomingMessage, res: http_2.ServerResponse, options?: ServerOptions, callback?: ErrorCallback): void;
359
+ web(req: http.IncomingMessage, res: http.ServerResponse, options?: ServerOptions, callback?: ErrorCallback): void;
361
360
 
362
361
  /**
363
362
  * Used for proxying regular HTTP(S) requests
@@ -367,7 +366,7 @@ declare namespace HttpProxy {
367
366
  * @param options - Additional options.
368
367
  * @param callback - Error callback.
369
368
  */
370
- ws(req: http_2.IncomingMessage, socket: unknown, head: unknown, options?: ServerOptions, callback?: ErrorCallback): void;
369
+ ws(req: http.IncomingMessage, socket: unknown, head: unknown, options?: ServerOptions, callback?: ErrorCallback): void;
371
370
 
372
371
  /**
373
372
  * A function that wraps the object in a webserver, for your convenience
@@ -403,13 +402,13 @@ declare namespace HttpProxy {
403
402
  addListener(event: string, listener: () => void): this;
404
403
  on(event: string, listener: () => void): this;
405
404
  on(event: 'error', listener: ErrorCallback): this;
406
- on(event: 'start', listener: (req: http_2.IncomingMessage, res: http_2.ServerResponse, target: ProxyTargetUrl) => void): this;
407
- on(event: 'proxyReq', listener: (proxyReq: http_2.ClientRequest, req: http_2.IncomingMessage, res: http_2.ServerResponse, options: ServerOptions) => void): this;
408
- on(event: 'proxyRes', listener: (proxyRes: http_2.IncomingMessage, req: http_2.IncomingMessage, res: http_2.ServerResponse) => void): this;
409
- on(event: 'proxyReqWs', listener: (proxyReq: http_2.ClientRequest, req: http_2.IncomingMessage, socket: net.Socket, options: ServerOptions, head: any) => void): this;
410
- on(event: 'econnreset', listener: (err: Error, req: http_2.IncomingMessage, res: http_2.ServerResponse, target: ProxyTargetUrl) => void): this;
411
- on(event: 'end', listener: (req: http_2.IncomingMessage, res: http_2.ServerResponse, proxyRes: http_2.IncomingMessage) => void): this;
412
- on(event: 'close', listener: (proxyRes: http_2.IncomingMessage, proxySocket: net.Socket, proxyHead: any) => void): this;
405
+ on(event: 'start', listener: (req: http.IncomingMessage, res: http.ServerResponse, target: ProxyTargetUrl) => void): this;
406
+ on(event: 'proxyReq', listener: (proxyReq: http.ClientRequest, req: http.IncomingMessage, res: http.ServerResponse, options: ServerOptions) => void): this;
407
+ on(event: 'proxyRes', listener: (proxyRes: http.IncomingMessage, req: http.IncomingMessage, res: http.ServerResponse) => void): this;
408
+ on(event: 'proxyReqWs', listener: (proxyReq: http.ClientRequest, req: http.IncomingMessage, socket: net.Socket, options: ServerOptions, head: any) => void): this;
409
+ on(event: 'econnreset', listener: (err: Error, req: http.IncomingMessage, res: http.ServerResponse, target: ProxyTargetUrl) => void): this;
410
+ on(event: 'end', listener: (req: http.IncomingMessage, res: http.ServerResponse, proxyRes: http.IncomingMessage) => void): this;
411
+ on(event: 'close', listener: (proxyRes: http.IncomingMessage, proxySocket: net.Socket, proxyHead: any) => void): this;
413
412
  once(event: string, listener: () => void): this;
414
413
  removeListener(event: string, listener: () => void): this;
415
414
  removeAllListeners(event?: string): this;
@@ -492,8 +491,8 @@ interface ProxyOptions extends HttpProxy.ServerOptions {
492
491
  /**
493
492
  * webpack-dev-server style bypass function
494
493
  */
495
- bypass?: (req: http_1.IncomingMessage, /** undefined for WebSocket upgrade requests */
496
- res: http_1.ServerResponse | undefined, options: ProxyOptions) => void | null | undefined | false | string | Promise<void | null | undefined | boolean | string>;
494
+ bypass?: (req: http.IncomingMessage, /** undefined for WebSocket upgrade requests */
495
+ res: http.ServerResponse | undefined, options: ProxyOptions) => void | null | undefined | false | string | Promise<void | null | undefined | boolean | string>;
497
496
  /**
498
497
  * rewrite the Origin header of a WebSocket request to match the target
499
498
  *
@@ -1773,214 +1772,8 @@ interface RollupDynamicImportVarsOptions {
1773
1772
  warnOnError?: boolean;
1774
1773
  }
1775
1774
  //#endregion
1776
- //#region src/types/terser.d.ts
1777
- // Modified and inlined to avoid extra dependency
1778
- // Source: https://github.com/terser/terser/blob/master/tools/terser.d.ts
1779
- // BSD Licensed https://github.com/terser/terser/blob/master/LICENSE
1780
-
1781
- declare namespace Terser {
1782
- export type ECMA = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020;
1783
- export type ConsoleProperty = keyof typeof console;
1784
- type DropConsoleOption = boolean | ConsoleProperty[];
1785
- export interface ParseOptions {
1786
- bare_returns?: boolean;
1787
- /** @deprecated legacy option. Currently, all supported EcmaScript is valid to parse. */
1788
- ecma?: ECMA;
1789
- html5_comments?: boolean;
1790
- shebang?: boolean;
1791
- }
1792
- export interface CompressOptions {
1793
- arguments?: boolean;
1794
- arrows?: boolean;
1795
- booleans_as_integers?: boolean;
1796
- booleans?: boolean;
1797
- collapse_vars?: boolean;
1798
- comparisons?: boolean;
1799
- computed_props?: boolean;
1800
- conditionals?: boolean;
1801
- dead_code?: boolean;
1802
- defaults?: boolean;
1803
- directives?: boolean;
1804
- drop_console?: DropConsoleOption;
1805
- drop_debugger?: boolean;
1806
- ecma?: ECMA;
1807
- evaluate?: boolean;
1808
- expression?: boolean;
1809
- global_defs?: object;
1810
- hoist_funs?: boolean;
1811
- hoist_props?: boolean;
1812
- hoist_vars?: boolean;
1813
- ie8?: boolean;
1814
- if_return?: boolean;
1815
- inline?: boolean | InlineFunctions;
1816
- join_vars?: boolean;
1817
- keep_classnames?: boolean | RegExp;
1818
- keep_fargs?: boolean;
1819
- keep_fnames?: boolean | RegExp;
1820
- keep_infinity?: boolean;
1821
- loops?: boolean;
1822
- module?: boolean;
1823
- negate_iife?: boolean;
1824
- passes?: number;
1825
- properties?: boolean;
1826
- pure_funcs?: string[];
1827
- pure_new?: boolean;
1828
- pure_getters?: boolean | 'strict';
1829
- reduce_funcs?: boolean;
1830
- reduce_vars?: boolean;
1831
- sequences?: boolean | number;
1832
- side_effects?: boolean;
1833
- switches?: boolean;
1834
- toplevel?: boolean;
1835
- top_retain?: null | string | string[] | RegExp;
1836
- typeofs?: boolean;
1837
- unsafe_arrows?: boolean;
1838
- unsafe?: boolean;
1839
- unsafe_comps?: boolean;
1840
- unsafe_Function?: boolean;
1841
- unsafe_math?: boolean;
1842
- unsafe_symbols?: boolean;
1843
- unsafe_methods?: boolean;
1844
- unsafe_proto?: boolean;
1845
- unsafe_regexp?: boolean;
1846
- unsafe_undefined?: boolean;
1847
- unused?: boolean;
1848
- }
1849
- export enum InlineFunctions {
1850
- Disabled = 0,
1851
- SimpleFunctions = 1,
1852
- WithArguments = 2,
1853
- WithArgumentsAndVariables = 3,
1854
- }
1855
- export interface MangleOptions {
1856
- eval?: boolean;
1857
- keep_classnames?: boolean | RegExp;
1858
- keep_fnames?: boolean | RegExp;
1859
- module?: boolean;
1860
- nth_identifier?: SimpleIdentifierMangler | WeightedIdentifierMangler;
1861
- properties?: boolean | ManglePropertiesOptions;
1862
- reserved?: string[];
1863
- safari10?: boolean;
1864
- toplevel?: boolean;
1865
- }
1866
-
1867
- /**
1868
- * An identifier mangler for which the output is invariant with respect to the source code.
1869
- */
1870
- export interface SimpleIdentifierMangler {
1871
- /**
1872
- * Obtains the nth most favored (usually shortest) identifier to rename a variable to.
1873
- * The mangler will increment n and retry until the return value is not in use in scope, and is not a reserved word.
1874
- * This function is expected to be stable; Evaluating get(n) === get(n) should always return true.
1875
- * @param n The ordinal of the identifier.
1876
- */
1877
- get(n: number): string;
1878
- }
1879
-
1880
- /**
1881
- * An identifier mangler that leverages character frequency analysis to determine identifier precedence.
1882
- */
1883
- export interface WeightedIdentifierMangler extends SimpleIdentifierMangler {
1884
- /**
1885
- * Modifies the internal weighting of the input characters by the specified delta.
1886
- * Will be invoked on the entire printed AST, and then deduct mangleable identifiers.
1887
- * @param chars The characters to modify the weighting of.
1888
- * @param delta The numeric weight to add to the characters.
1889
- */
1890
- consider(chars: string, delta: number): number;
1891
- /**
1892
- * Resets character weights.
1893
- */
1894
- reset(): void;
1895
- /**
1896
- * Sorts identifiers by character frequency, in preparation for calls to get(n).
1897
- */
1898
- sort(): void;
1899
- }
1900
- export interface ManglePropertiesOptions {
1901
- builtins?: boolean;
1902
- debug?: boolean;
1903
- keep_quoted?: boolean | 'strict';
1904
- nth_identifier?: SimpleIdentifierMangler | WeightedIdentifierMangler;
1905
- regex?: RegExp | string;
1906
- reserved?: string[];
1907
- }
1908
- export interface FormatOptions {
1909
- ascii_only?: boolean;
1910
- /** @deprecated Not implemented anymore */
1911
- beautify?: boolean;
1912
- braces?: boolean;
1913
- comments?: boolean | 'all' | 'some' | RegExp | ((node: any, comment: {
1914
- value: string;
1915
- type: 'comment1' | 'comment2' | 'comment3' | 'comment4';
1916
- pos: number;
1917
- line: number;
1918
- col: number;
1919
- }) => boolean);
1920
- ecma?: ECMA;
1921
- ie8?: boolean;
1922
- keep_numbers?: boolean;
1923
- indent_level?: number;
1924
- indent_start?: number;
1925
- inline_script?: boolean;
1926
- keep_quoted_props?: boolean;
1927
- max_line_len?: number | false;
1928
- preamble?: string;
1929
- preserve_annotations?: boolean;
1930
- quote_keys?: boolean;
1931
- quote_style?: OutputQuoteStyle;
1932
- safari10?: boolean;
1933
- semicolons?: boolean;
1934
- shebang?: boolean;
1935
- shorthand?: boolean;
1936
- source_map?: SourceMapOptions;
1937
- webkit?: boolean;
1938
- width?: number;
1939
- wrap_iife?: boolean;
1940
- wrap_func_args?: boolean;
1941
- }
1942
- export enum OutputQuoteStyle {
1943
- PreferDouble = 0,
1944
- AlwaysSingle = 1,
1945
- AlwaysDouble = 2,
1946
- AlwaysOriginal = 3,
1947
- }
1948
- export interface MinifyOptions {
1949
- compress?: boolean | CompressOptions;
1950
- ecma?: ECMA;
1951
- enclose?: boolean | string;
1952
- ie8?: boolean;
1953
- keep_classnames?: boolean | RegExp;
1954
- keep_fnames?: boolean | RegExp;
1955
- mangle?: boolean | MangleOptions;
1956
- module?: boolean;
1957
- nameCache?: object;
1958
- format?: FormatOptions;
1959
- /** @deprecated */
1960
- output?: FormatOptions;
1961
- parse?: ParseOptions;
1962
- safari10?: boolean;
1963
- sourceMap?: boolean | SourceMapOptions;
1964
- toplevel?: boolean;
1965
- }
1966
- export interface MinifyOutput {
1967
- code?: string;
1968
- map?: object | string;
1969
- decoded_map?: object | null;
1970
- }
1971
- export interface SourceMapOptions {
1972
- /** Source map object, 'inline' or source map file content */
1973
- content?: object | string;
1974
- includeSources?: boolean;
1975
- filename?: string;
1976
- root?: string;
1977
- asObject?: boolean;
1978
- url?: string | 'inline';
1979
- }
1980
- }
1981
- //#endregion
1982
1775
  //#region src/node/plugins/terser.d.ts
1983
- interface TerserOptions extends Terser.MinifyOptions {
1776
+ interface TerserOptions extends TerserMinifyOptions {
1984
1777
  /**
1985
1778
  * Vite-specific option to specify the max number of workers to spawn
1986
1779
  * when minifying files with terser.
@@ -1,5 +1,5 @@
1
1
  import { createRequire as ___createRequire } from 'module'; const require = ___createRequire(import.meta.url);
2
- import { BuildEnvironment, DevEnvironment, build, buildErrorMessage, createBuilder, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, normalizePath, optimizeDeps, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, ssrTransform, transformWithEsbuild } from "./chunks/dep-Bkc4tc5S.js";
2
+ import { BuildEnvironment, DevEnvironment, build, buildErrorMessage, createBuilder, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, normalizePath, optimizeDeps, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, ssrTransform, transformWithEsbuild } from "./chunks/dep-DJGyAxkV.js";
3
3
  import { DEFAULT_CLIENT_CONDITIONS, DEFAULT_CLIENT_MAIN_FIELDS, DEFAULT_SERVER_CONDITIONS, DEFAULT_SERVER_MAIN_FIELDS, VERSION, defaultAllowedOrigins } from "./chunks/dep-Ctugieod.js";
4
4
  import { parseAst, parseAstAsync } from "rollup/parseAst";
5
5
  import { version as esbuildVersion } from "esbuild";
@@ -288,6 +288,7 @@ declare class EvaluatedModules {
288
288
  getModuleSourceMapById(id: string): DecodedMap | null;
289
289
  clear(): void;
290
290
  }
291
+ declare function normalizeModuleId(file: string): string;
291
292
  //#endregion
292
293
  //#region src/module-runner/esmEvaluator.d.ts
293
294
  declare class ESModulesEvaluator implements ModuleEvaluator {
@@ -296,4 +297,4 @@ declare class ESModulesEvaluator implements ModuleEvaluator {
296
297
  runExternalModule(filepath: string): Promise<any>;
297
298
  }
298
299
  //#endregion
299
- export { ESModulesEvaluator, EvaluatedModuleNode, EvaluatedModules, FetchFunction, FetchFunctionOptions, FetchResult, HMRLogger, InterceptorOptions, ModuleEvaluator, ModuleRunner, ModuleRunnerContext, ModuleRunnerHmr, ModuleRunnerImportMeta, ModuleRunnerOptions, ModuleRunnerTransport, ModuleRunnerTransportHandlers, ResolvedResult, SSRImportMetadata, createWebSocketModuleRunnerTransport, ssrDynamicImportKey, ssrExportAllKey, ssrImportKey, ssrImportMetaKey, ssrModuleExportsKey };
300
+ export { ESModulesEvaluator, EvaluatedModuleNode, EvaluatedModules, FetchFunction, FetchFunctionOptions, FetchResult, HMRLogger, InterceptorOptions, ModuleEvaluator, ModuleRunner, ModuleRunnerContext, ModuleRunnerHmr, ModuleRunnerImportMeta, ModuleRunnerOptions, ModuleRunnerTransport, ModuleRunnerTransportHandlers, ResolvedResult, SSRImportMetadata, createWebSocketModuleRunnerTransport, normalizeModuleId, ssrDynamicImportKey, ssrExportAllKey, ssrExportNameKey, ssrImportKey, ssrImportMetaKey, ssrModuleExportsKey };