vite 7.2.4 → 8.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +55 -90
- package/dist/client/client.mjs +4 -4
- package/dist/node/chunks/build.js +1 -1
- package/dist/node/chunks/build2.js +123 -123
- package/dist/node/chunks/chunk.js +26 -9
- package/dist/node/chunks/config.js +3 -36618
- package/dist/node/chunks/lib.js +11 -11
- package/dist/node/chunks/logger.js +10 -14
- package/dist/node/chunks/node.js +35583 -0
- package/dist/node/chunks/optimizer.js +1 -1
- package/dist/node/chunks/postcss-import.js +21 -21
- package/dist/node/chunks/preview.js +1 -1
- package/dist/node/chunks/server.js +1 -1
- package/dist/node/cli.js +3 -3
- package/dist/node/index.d.ts +199 -41
- package/dist/node/index.js +2 -28
- package/dist/node/internal.d.ts +2 -0
- package/dist/node/internal.js +3 -0
- package/package.json +18 -25
- package/types/customEvent.d.ts +1 -1
- package/types/hot.d.ts +1 -1
- package/types/importMeta.d.ts +2 -2
- package/types/internal/esbuildOptions.d.ts +28 -0
- package/types/internal/rollupTypeCompat.d.ts +24 -0
- package/types/metadata.d.ts +6 -1
- package/dist/node/chunks/config2.js +0 -4
- package/types/package.json +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "./logger.js";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as extractExportsData, G as addManuallyIncludedOptimizeDeps, J as createIsOptimizedDepFile, K as addOptimizedDepInfo, Q as discoverProjectDependencies, X as depsFromOptimizedDepInfo, Y as createIsOptimizedDepUrl, Z as depsLogString, at as optimizeDeps, ct as optimizedDepInfoFromId, dt as toDiscoveredDependencies, et as getDepsCacheDir, it as loadCachedDepOptimizationMetadata, lt as optimizedDepNeedsInterop, nt as initDepsOptimizerMetadata, ot as optimizeExplicitEnvironmentDeps, q as cleanupDepsCacheStaleDirs, rt as isDepOptimizationDisabled, st as optimizedDepInfoFromFile, tt as getOptimizedDepPath, ut as runOptimizeDeps } from "./node.js";
|
|
3
3
|
|
|
4
4
|
export { optimizeDeps };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as __require, t as __commonJSMin } from "./chunk.js";
|
|
2
2
|
import { t as require_lib } from "./lib.js";
|
|
3
3
|
|
|
4
4
|
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/format-import-prelude.js
|
|
5
|
-
var require_format_import_prelude = /* @__PURE__ */
|
|
5
|
+
var require_format_import_prelude = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6
6
|
module.exports = function formatImportPrelude$2(layer, media, supports) {
|
|
7
7
|
const parts = [];
|
|
8
8
|
if (typeof layer !== "undefined") {
|
|
@@ -14,11 +14,11 @@ var require_format_import_prelude = /* @__PURE__ */ __commonJS({ "../../node_mod
|
|
|
14
14
|
if (typeof media !== "undefined") parts.push(media);
|
|
15
15
|
return parts.join(" ");
|
|
16
16
|
};
|
|
17
|
-
})
|
|
17
|
+
}));
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/base64-encoded-import.js
|
|
21
|
-
var require_base64_encoded_import = /* @__PURE__ */
|
|
21
|
+
var require_base64_encoded_import = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
22
22
|
const formatImportPrelude$1 = require_format_import_prelude();
|
|
23
23
|
module.exports = function base64EncodedConditionalImport$1(prelude, conditions) {
|
|
24
24
|
if (!conditions?.length) return prelude;
|
|
@@ -28,11 +28,11 @@ var require_base64_encoded_import = /* @__PURE__ */ __commonJS({ "../../node_mod
|
|
|
28
28
|
for (const condition of conditions) params = `'data:text/css;base64,${Buffer.from(`@import ${params}`).toString("base64")}' ${formatImportPrelude$1(condition.layer, condition.media, condition.supports)}`;
|
|
29
29
|
return params;
|
|
30
30
|
};
|
|
31
|
-
})
|
|
31
|
+
}));
|
|
32
32
|
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/apply-conditions.js
|
|
35
|
-
var require_apply_conditions = /* @__PURE__ */
|
|
35
|
+
var require_apply_conditions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
36
36
|
const base64EncodedConditionalImport = require_base64_encoded_import();
|
|
37
37
|
module.exports = function applyConditions$1(bundle, atRule) {
|
|
38
38
|
const firstImportStatementIndex = bundle.findIndex((stmt) => stmt.type === "import");
|
|
@@ -104,11 +104,11 @@ var require_apply_conditions = /* @__PURE__ */ __commonJS({ "../../node_modules/
|
|
|
104
104
|
delete stmt.node;
|
|
105
105
|
});
|
|
106
106
|
};
|
|
107
|
-
})
|
|
107
|
+
}));
|
|
108
108
|
|
|
109
109
|
//#endregion
|
|
110
110
|
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/apply-raws.js
|
|
111
|
-
var require_apply_raws = /* @__PURE__ */
|
|
111
|
+
var require_apply_raws = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
112
112
|
module.exports = function applyRaws$1(bundle) {
|
|
113
113
|
bundle.forEach((stmt, index) => {
|
|
114
114
|
if (index === 0) return;
|
|
@@ -119,11 +119,11 @@ var require_apply_raws = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
119
119
|
} else if (stmt.type === "nodes") stmt.nodes[0].raws.before = stmt.nodes[0].raws.before || "\n";
|
|
120
120
|
});
|
|
121
121
|
};
|
|
122
|
-
})
|
|
122
|
+
}));
|
|
123
123
|
|
|
124
124
|
//#endregion
|
|
125
125
|
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/apply-styles.js
|
|
126
|
-
var require_apply_styles = /* @__PURE__ */
|
|
126
|
+
var require_apply_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
127
127
|
module.exports = function applyStyles$1(bundle, styles) {
|
|
128
128
|
styles.nodes = [];
|
|
129
129
|
bundle.forEach((stmt) => {
|
|
@@ -140,11 +140,11 @@ var require_apply_styles = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
|
|
|
140
140
|
});
|
|
141
141
|
});
|
|
142
142
|
};
|
|
143
|
-
})
|
|
143
|
+
}));
|
|
144
144
|
|
|
145
145
|
//#endregion
|
|
146
146
|
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/data-url.js
|
|
147
|
-
var require_data_url = /* @__PURE__ */
|
|
147
|
+
var require_data_url = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
148
148
|
const anyDataURLRegexp = /^data:text\/css(?:;(base64|plain))?,/i;
|
|
149
149
|
const base64DataURLRegexp = /^data:text\/css;base64,/i;
|
|
150
150
|
const plainDataURLRegexp = /^data:text\/css;plain,/i;
|
|
@@ -160,11 +160,11 @@ var require_data_url = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/po
|
|
|
160
160
|
isValid,
|
|
161
161
|
contents
|
|
162
162
|
};
|
|
163
|
-
})
|
|
163
|
+
}));
|
|
164
164
|
|
|
165
165
|
//#endregion
|
|
166
166
|
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/parse-statements.js
|
|
167
|
-
var require_parse_statements = /* @__PURE__ */
|
|
167
|
+
var require_parse_statements = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
168
168
|
const valueParser = require_lib();
|
|
169
169
|
const { stringify } = valueParser;
|
|
170
170
|
module.exports = function parseStatements$1(result, styles, conditions, from) {
|
|
@@ -286,11 +286,11 @@ var require_parse_statements = /* @__PURE__ */ __commonJS({ "../../node_modules/
|
|
|
286
286
|
from
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
|
-
})
|
|
289
|
+
}));
|
|
290
290
|
|
|
291
291
|
//#endregion
|
|
292
292
|
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/process-content.js
|
|
293
|
-
var require_process_content = /* @__PURE__ */
|
|
293
|
+
var require_process_content = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
294
294
|
const path$2 = __require("path");
|
|
295
295
|
let sugarss;
|
|
296
296
|
module.exports = function processContent$1(result, content, filename, options, postcss) {
|
|
@@ -321,11 +321,11 @@ var require_process_content = /* @__PURE__ */ __commonJS({ "../../node_modules/.
|
|
|
321
321
|
return runPostcss(postcss, content, filename, plugins, parsers, index);
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
|
-
})
|
|
324
|
+
}));
|
|
325
325
|
|
|
326
326
|
//#endregion
|
|
327
327
|
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/parse-styles.js
|
|
328
|
-
var require_parse_styles = /* @__PURE__ */
|
|
328
|
+
var require_parse_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
329
329
|
const path$1 = __require("path");
|
|
330
330
|
const dataURL = require_data_url();
|
|
331
331
|
const parseStatements = require_parse_statements();
|
|
@@ -425,11 +425,11 @@ var require_parse_styles = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
|
|
|
425
425
|
return true;
|
|
426
426
|
}
|
|
427
427
|
module.exports = parseStyles$1;
|
|
428
|
-
})
|
|
428
|
+
}));
|
|
429
429
|
|
|
430
430
|
//#endregion
|
|
431
431
|
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/index.js
|
|
432
|
-
var require_postcss_import = /* @__PURE__ */
|
|
432
|
+
var require_postcss_import = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
433
433
|
const path = __require("path");
|
|
434
434
|
const applyConditions = require_apply_conditions();
|
|
435
435
|
const applyRaws = require_apply_raws();
|
|
@@ -471,7 +471,7 @@ var require_postcss_import = /* @__PURE__ */ __commonJS({ "../../node_modules/.p
|
|
|
471
471
|
}
|
|
472
472
|
AtImport.postcss = true;
|
|
473
473
|
module.exports = AtImport;
|
|
474
|
-
})
|
|
474
|
+
}));
|
|
475
475
|
|
|
476
476
|
//#endregion
|
|
477
477
|
export default require_postcss_import();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "./logger.js";
|
|
2
|
-
import {
|
|
2
|
+
import { _t as restartServerWithUrls, gt as resolveServerOptions, ht as createServerCloseFn, mt as createServer, pt as _createServer, vt as serverConfigDefaults } from "./node.js";
|
|
3
3
|
|
|
4
4
|
export { createServer };
|
package/dist/node/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as __toESM } from "./chunks/chunk.js";
|
|
2
2
|
import { N as VERSION, R as require_picocolors, n as createLogger } from "./chunks/logger.js";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
@@ -564,7 +564,7 @@ const convertBase = (v) => {
|
|
|
564
564
|
if (v === 0) return "";
|
|
565
565
|
return v;
|
|
566
566
|
};
|
|
567
|
-
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
|
|
567
|
+
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`);
|
|
568
568
|
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) => {
|
|
569
569
|
filterDuplicateOptions(options);
|
|
570
570
|
const { createServer } = await import("./chunks/server.js");
|
|
@@ -646,7 +646,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
|
646
646
|
});
|
|
647
647
|
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) => {
|
|
648
648
|
filterDuplicateOptions(options);
|
|
649
|
-
const { resolveConfig } = await import("./chunks/
|
|
649
|
+
const { resolveConfig } = await import("./chunks/config.js");
|
|
650
650
|
const { optimizeDeps } = await import("./chunks/optimizer.js");
|
|
651
651
|
try {
|
|
652
652
|
await optimizeDeps(await resolveConfig({
|