vite 6.0.0-beta.8 → 6.0.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.
Potentially problematic release.
This version of vite might be problematic. Click here for more details.
- package/LICENSE.md +247 -13
- package/client.d.ts +14 -0
- package/dist/client/client.mjs +343 -93
- package/dist/node/chunks/dep-0q9rEWat.js +822 -0
- package/dist/node/chunks/dep-3RmXg9uo.js +553 -0
- package/dist/node/chunks/dep-C1dfssTZ.js +7002 -0
- package/dist/node/chunks/{dep-Ddvoc4zx.js → dep-C6qYk3zB.js} +21241 -16553
- package/dist/node/chunks/{dep-CdoEeCn3.js → dep-DnSxfB-q.js} +0 -4
- package/dist/node/cli.js +7 -8
- package/dist/node/constants.js +13 -18
- package/dist/node/index.d.ts +1728 -1590
- package/dist/node/index.js +6 -38
- package/dist/node/module-runner.d.ts +92 -99
- package/dist/node/module-runner.js +269 -94
- package/dist/node-cjs/publicUtils.cjs +2699 -2747
- package/index.cjs +35 -3
- package/misc/false.js +1 -0
- package/misc/true.js +1 -0
- package/package.json +32 -31
- package/types/hmrPayload.d.ts +5 -0
- package/dist/node/chunks/dep-DUn1iy3F.js +0 -913
- package/dist/node/chunks/dep-mtw2NpNs.js +0 -589
- package/dist/node/chunks/dep-qU9-vqRp.js +0 -7216
@@ -1,7 +1,3 @@
|
|
1
|
-
import { createRequire as __cjs_createRequire } from 'node:module';
|
2
|
-
|
3
|
-
const require = __cjs_createRequire(import.meta.url);
|
4
|
-
const __require = require;
|
5
1
|
const UNDEFINED_CODE_POINTS = new Set([
|
6
2
|
65534, 65535, 131070, 131071, 196606, 196607, 262142, 262143, 327678, 327679, 393214,
|
7
3
|
393215, 458750, 458751, 524286, 524287, 589822, 589823, 655358, 655359, 720894,
|
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 {
|
5
|
+
import { M as colors, G as createLogger, r as resolveConfig } from './chunks/dep-C6qYk3zB.js';
|
6
6
|
import { VERSION } from './constants.js';
|
7
7
|
import 'node:fs/promises';
|
8
8
|
import 'node:url';
|
@@ -19,7 +19,6 @@ import 'util';
|
|
19
19
|
import 'net';
|
20
20
|
import 'url';
|
21
21
|
import 'http';
|
22
|
-
import 'fs/promises';
|
23
22
|
import 'stream';
|
24
23
|
import 'os';
|
25
24
|
import 'child_process';
|
@@ -32,17 +31,17 @@ import 'module';
|
|
32
31
|
import 'node:readline';
|
33
32
|
import 'node:process';
|
34
33
|
import 'node:buffer';
|
34
|
+
import 'node:events';
|
35
35
|
import 'crypto';
|
36
36
|
import 'node:assert';
|
37
37
|
import 'node:v8';
|
38
38
|
import 'node:worker_threads';
|
39
|
-
import 'node:events';
|
40
39
|
import 'zlib';
|
41
40
|
import 'buffer';
|
42
41
|
import 'https';
|
43
42
|
import 'tls';
|
44
43
|
import 'assert';
|
45
|
-
import 'querystring';
|
44
|
+
import 'node:querystring';
|
46
45
|
import 'node:zlib';
|
47
46
|
|
48
47
|
function toArr(any) {
|
@@ -741,7 +740,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
|
|
741
740
|
`[boolean] force the optimizer to ignore the cache and re-bundle`
|
742
741
|
).action(async (root, options) => {
|
743
742
|
filterDuplicateOptions(options);
|
744
|
-
const { createServer } = await import('./chunks/dep-
|
743
|
+
const { createServer } = await import('./chunks/dep-C6qYk3zB.js').then(function (n) { return n.Q; });
|
745
744
|
try {
|
746
745
|
const server = await createServer({
|
747
746
|
root,
|
@@ -834,7 +833,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
834
833
|
).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as \`builder: {}\``).action(
|
835
834
|
async (root, options) => {
|
836
835
|
filterDuplicateOptions(options);
|
837
|
-
const { createBuilder } = await import('./chunks/dep-
|
836
|
+
const { createBuilder } = await import('./chunks/dep-C6qYk3zB.js').then(function (n) { return n.R; });
|
838
837
|
const buildOptions = cleanGlobalCLIOptions(
|
839
838
|
cleanBuilderCLIOptions(options)
|
840
839
|
);
|
@@ -869,7 +868,7 @@ cli.command("optimize [root]", "pre-bundle dependencies").option(
|
|
869
868
|
).action(
|
870
869
|
async (root, options) => {
|
871
870
|
filterDuplicateOptions(options);
|
872
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
871
|
+
const { optimizeDeps } = await import('./chunks/dep-C6qYk3zB.js').then(function (n) { return n.P; });
|
873
872
|
try {
|
874
873
|
const config = await resolveConfig(
|
875
874
|
{
|
@@ -895,7 +894,7 @@ ${e.stack}`),
|
|
895
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(
|
896
895
|
async (root, options) => {
|
897
896
|
filterDuplicateOptions(options);
|
898
|
-
const { preview } = await import('./chunks/dep-
|
897
|
+
const { preview } = await import('./chunks/dep-C6qYk3zB.js').then(function (n) { return n.S; });
|
899
898
|
try {
|
900
899
|
const server = await preview({
|
901
900
|
root,
|
package/dist/node/constants.js
CHANGED
@@ -42,14 +42,18 @@ const DEFAULT_MAIN_FIELDS = [
|
|
42
42
|
// moment still uses this...
|
43
43
|
"jsnext"
|
44
44
|
];
|
45
|
+
const DEFAULT_CLIENT_MAIN_FIELDS = Object.freeze(DEFAULT_MAIN_FIELDS);
|
46
|
+
const DEFAULT_SERVER_MAIN_FIELDS = Object.freeze(
|
47
|
+
DEFAULT_MAIN_FIELDS.filter((f) => f !== "browser")
|
48
|
+
);
|
45
49
|
const DEV_PROD_CONDITION = `development|production`;
|
46
|
-
const DEFAULT_CONDITIONS = [
|
47
|
-
|
48
|
-
"
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
const DEFAULT_CONDITIONS = ["module", "browser", "node", DEV_PROD_CONDITION];
|
51
|
+
const DEFAULT_CLIENT_CONDITIONS = Object.freeze(
|
52
|
+
DEFAULT_CONDITIONS.filter((c) => c !== "node")
|
53
|
+
);
|
54
|
+
const DEFAULT_SERVER_CONDITIONS = Object.freeze(
|
55
|
+
DEFAULT_CONDITIONS.filter((c) => c !== "browser")
|
56
|
+
);
|
53
57
|
const ESBUILD_MODULES_TARGET = [
|
54
58
|
"es2020",
|
55
59
|
// support import.meta.url
|
@@ -58,15 +62,6 @@ const ESBUILD_MODULES_TARGET = [
|
|
58
62
|
"chrome87",
|
59
63
|
"safari14"
|
60
64
|
];
|
61
|
-
const DEFAULT_EXTENSIONS = [
|
62
|
-
".mjs",
|
63
|
-
".js",
|
64
|
-
".mts",
|
65
|
-
".ts",
|
66
|
-
".jsx",
|
67
|
-
".tsx",
|
68
|
-
".json"
|
69
|
-
];
|
70
65
|
const DEFAULT_CONFIG_FILES = [
|
71
66
|
"vite.config.js",
|
72
67
|
"vite.config.mjs",
|
@@ -104,6 +99,7 @@ const KNOWN_ASSET_TYPES = [
|
|
104
99
|
"ico",
|
105
100
|
"webp",
|
106
101
|
"avif",
|
102
|
+
"cur",
|
107
103
|
// media
|
108
104
|
"mp4",
|
109
105
|
"webm",
|
@@ -146,7 +142,6 @@ const DEFAULT_PREVIEW_PORT = 4173;
|
|
146
142
|
const DEFAULT_ASSETS_INLINE_LIMIT = 4096;
|
147
143
|
const METADATA_FILENAME = "_metadata.json";
|
148
144
|
const ERR_OPTIMIZE_DEPS_PROCESSING_ERROR = "ERR_OPTIMIZE_DEPS_PROCESSING_ERROR";
|
149
|
-
const ERR_OUTDATED_OPTIMIZED_DEP = "ERR_OUTDATED_OPTIMIZED_DEP";
|
150
145
|
const ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR = "ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR";
|
151
146
|
|
152
|
-
export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, CSS_LANGS_RE, DEFAULT_ASSETS_INLINE_LIMIT, DEFAULT_ASSETS_RE,
|
147
|
+
export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, CSS_LANGS_RE, DEFAULT_ASSETS_INLINE_LIMIT, DEFAULT_ASSETS_RE, DEFAULT_CLIENT_CONDITIONS, DEFAULT_CLIENT_MAIN_FIELDS, DEFAULT_CONFIG_FILES, DEFAULT_DEV_PORT, DEFAULT_PREVIEW_PORT, DEFAULT_SERVER_CONDITIONS, DEFAULT_SERVER_MAIN_FIELDS, DEP_VERSION_RE, DEV_PROD_CONDITION, ENV_ENTRY, ENV_PUBLIC_PATH, ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR, ERR_OPTIMIZE_DEPS_PROCESSING_ERROR, ESBUILD_MODULES_TARGET, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, METADATA_FILENAME, OPTIMIZABLE_ENTRY_RE, ROLLUP_HOOKS, SPECIAL_QUERY_RE, VERSION, VITE_PACKAGE_DIR, loopbackHosts, wildcardHosts };
|