vite 3.2.0-beta.4 → 3.2.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.
- package/LICENSE.md +0 -82
- package/dist/client/client.mjs +1 -1
- package/dist/client/client.mjs.map +1 -1
- package/dist/node/chunks/{dep-06c4efef.js → dep-9055f77d.js} +1 -1
- package/dist/node/chunks/{dep-0e9c6c9f.js → dep-d29b4e33.js} +627 -2321
- package/dist/node/cli.js +10 -8
- package/dist/node/constants.js +1 -1
- package/dist/node/index.d.ts +20 -1
- package/dist/node/index.js +2 -4
- package/dist/node-cjs/publicUtils.cjs +8 -9
- package/package.json +6 -7
- package/src/client/overlay.ts +1 -1
package/dist/node/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { performance } from 'node:perf_hooks';
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
|
-
import {
|
|
3
|
+
import { z as picocolors, v as createLogger, g as resolveConfig } from './chunks/dep-d29b4e33.js';
|
|
4
4
|
import { VERSION } from './constants.js';
|
|
5
5
|
import 'node:fs';
|
|
6
6
|
import 'node:path';
|
|
@@ -8,9 +8,6 @@ import 'node:url';
|
|
|
8
8
|
import 'node:module';
|
|
9
9
|
import 'tty';
|
|
10
10
|
import 'esbuild';
|
|
11
|
-
import 'node:assert';
|
|
12
|
-
import 'node:process';
|
|
13
|
-
import 'node:util';
|
|
14
11
|
import 'path';
|
|
15
12
|
import 'fs';
|
|
16
13
|
import 'assert';
|
|
@@ -23,6 +20,7 @@ import 'os';
|
|
|
23
20
|
import 'child_process';
|
|
24
21
|
import 'node:os';
|
|
25
22
|
import 'node:crypto';
|
|
23
|
+
import 'node:util';
|
|
26
24
|
import 'node:dns';
|
|
27
25
|
import 'resolve';
|
|
28
26
|
import 'crypto';
|
|
@@ -704,7 +702,7 @@ cli
|
|
|
704
702
|
filterDuplicateOptions(options);
|
|
705
703
|
// output structure is preserved even after bundling so require()
|
|
706
704
|
// is ok here
|
|
707
|
-
const { createServer } = await import('./chunks/dep-
|
|
705
|
+
const { createServer } = await import('./chunks/dep-d29b4e33.js').then(function (n) { return n.D; });
|
|
708
706
|
try {
|
|
709
707
|
const server = await createServer({
|
|
710
708
|
root,
|
|
@@ -752,7 +750,7 @@ cli
|
|
|
752
750
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
|
753
751
|
.action(async (root, options) => {
|
|
754
752
|
filterDuplicateOptions(options);
|
|
755
|
-
const { build } = await import('./chunks/dep-
|
|
753
|
+
const { build } = await import('./chunks/dep-d29b4e33.js').then(function (n) { return n.C; });
|
|
756
754
|
const buildOptions = cleanOptions(options);
|
|
757
755
|
try {
|
|
758
756
|
await build({
|
|
@@ -777,7 +775,7 @@ cli
|
|
|
777
775
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
|
778
776
|
.action(async (root, options) => {
|
|
779
777
|
filterDuplicateOptions(options);
|
|
780
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
|
778
|
+
const { optimizeDeps } = await import('./chunks/dep-d29b4e33.js').then(function (n) { return n.B; });
|
|
781
779
|
try {
|
|
782
780
|
const config = await resolveConfig({
|
|
783
781
|
root,
|
|
@@ -799,9 +797,10 @@ cli
|
|
|
799
797
|
.option('--strictPort', `[boolean] exit if specified port is already in use`)
|
|
800
798
|
.option('--https', `[boolean] use TLS + HTTP/2`)
|
|
801
799
|
.option('--open [path]', `[boolean | string] open browser on startup`)
|
|
800
|
+
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
|
802
801
|
.action(async (root, options) => {
|
|
803
802
|
filterDuplicateOptions(options);
|
|
804
|
-
const { preview } = await import('./chunks/dep-
|
|
803
|
+
const { preview } = await import('./chunks/dep-d29b4e33.js').then(function (n) { return n.E; });
|
|
805
804
|
try {
|
|
806
805
|
const server = await preview({
|
|
807
806
|
root,
|
|
@@ -809,6 +808,9 @@ cli
|
|
|
809
808
|
configFile: options.config,
|
|
810
809
|
logLevel: options.logLevel,
|
|
811
810
|
mode: options.mode,
|
|
811
|
+
build: {
|
|
812
|
+
outDir: options.outDir
|
|
813
|
+
},
|
|
812
814
|
preview: {
|
|
813
815
|
port: options.port,
|
|
814
816
|
strictPort: options.strictPort,
|
package/dist/node/constants.js
CHANGED
package/dist/node/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ import type { InputOptions } from 'rollup';
|
|
|
32
32
|
import { InvalidatePayload } from "../../types/customEvent";
|
|
33
33
|
import { KnownAsTypeMap } from "../../types/importGlob";
|
|
34
34
|
import type { LoadResult } from 'rollup';
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
import type { ModuleFormat } from 'rollup';
|
|
37
37
|
import type { ModuleInfo } from 'rollup';
|
|
38
38
|
import type * as net from 'node:net';
|
|
@@ -59,6 +59,7 @@ import type { ServerOptions as ServerOptions_2 } from 'node:https';
|
|
|
59
59
|
import type { ServerResponse } from 'node:http';
|
|
60
60
|
import type { SourceDescription } from 'rollup';
|
|
61
61
|
import type { SourceMap } from 'rollup';
|
|
62
|
+
import type { SourceMapInput } from 'rollup';
|
|
62
63
|
import type * as stream from 'node:stream';
|
|
63
64
|
import type { TransformPluginContext } from 'rollup';
|
|
64
65
|
import type { TransformResult as TransformResult_2 } from 'rollup';
|
|
@@ -230,6 +231,12 @@ export declare interface BuildOptions {
|
|
|
230
231
|
* @default true when outDir is a sub directory of project root
|
|
231
232
|
*/
|
|
232
233
|
emptyOutDir?: boolean | null;
|
|
234
|
+
/**
|
|
235
|
+
* Copy the public directory to outDir on write.
|
|
236
|
+
* @default true
|
|
237
|
+
* @experimental
|
|
238
|
+
*/
|
|
239
|
+
copyPublicDir?: boolean;
|
|
233
240
|
/**
|
|
234
241
|
* Whether to emit a manifest.json under assets dir to map hash-less filenames
|
|
235
242
|
* to their hashed versions. Useful when you want to generate your own HTML
|
|
@@ -1528,6 +1535,18 @@ export declare interface PluginHookUtils {
|
|
|
1528
1535
|
|
|
1529
1536
|
export declare type PluginOption = Plugin_2 | false | null | undefined | PluginOption[] | Promise<Plugin_2 | false | null | undefined | PluginOption[]>;
|
|
1530
1537
|
|
|
1538
|
+
/**
|
|
1539
|
+
* @experimental
|
|
1540
|
+
*/
|
|
1541
|
+
export declare function preprocessCSS(code: string, filename: string, config: ResolvedConfig): Promise<PreprocessCSSResult>;
|
|
1542
|
+
|
|
1543
|
+
export declare interface PreprocessCSSResult {
|
|
1544
|
+
code: string;
|
|
1545
|
+
map?: SourceMapInput;
|
|
1546
|
+
modules?: Record<string, string>;
|
|
1547
|
+
deps?: Set<string>;
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1531
1550
|
/**
|
|
1532
1551
|
* Starts the Vite server in preview mode, to simulate a production deployment
|
|
1533
1552
|
*/
|
package/dist/node/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as build,
|
|
1
|
+
export { b as build, q as createFilter, v as createLogger, c as createServer, e as defineConfig, f as formatPostcssSourceMap, i as getDepOptimizationConfig, j as isDepsOptimizerEnabled, l as loadConfigFromFile, x as loadEnv, k as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, h as resolveBaseUrl, g as resolveConfig, y as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-d29b4e33.js';
|
|
2
2
|
export { VERSION as version } from './constants.js';
|
|
3
3
|
export { version as esbuildVersion } from 'esbuild';
|
|
4
4
|
export { VERSION as rollupVersion } from 'rollup';
|
|
@@ -8,9 +8,6 @@ import 'node:url';
|
|
|
8
8
|
import 'node:perf_hooks';
|
|
9
9
|
import 'node:module';
|
|
10
10
|
import 'tty';
|
|
11
|
-
import 'node:assert';
|
|
12
|
-
import 'node:process';
|
|
13
|
-
import 'node:util';
|
|
14
11
|
import 'path';
|
|
15
12
|
import 'fs';
|
|
16
13
|
import 'events';
|
|
@@ -24,6 +21,7 @@ import 'os';
|
|
|
24
21
|
import 'child_process';
|
|
25
22
|
import 'node:os';
|
|
26
23
|
import 'node:crypto';
|
|
24
|
+
import 'node:util';
|
|
27
25
|
import 'node:dns';
|
|
28
26
|
import 'resolve';
|
|
29
27
|
import 'crypto';
|
|
@@ -31,7 +31,7 @@ var require$$1__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$1$1);
|
|
|
31
31
|
var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);
|
|
32
32
|
var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);
|
|
33
33
|
|
|
34
|
-
var version = "3.2.
|
|
34
|
+
var version = "3.2.1";
|
|
35
35
|
|
|
36
36
|
const VERSION = version;
|
|
37
37
|
const VITE_PACKAGE_DIR = path$3.resolve(
|
|
@@ -4183,14 +4183,6 @@ function loadEnv(mode, envDir, prefixes = 'VITE_') {
|
|
|
4183
4183
|
/** mode file */ `.env.${mode}`,
|
|
4184
4184
|
/** mode local file */ `.env.${mode}.local`
|
|
4185
4185
|
];
|
|
4186
|
-
// check if there are actual env variables starting with VITE_*
|
|
4187
|
-
// these are typically provided inline and should be prioritized
|
|
4188
|
-
for (const key in process.env) {
|
|
4189
|
-
if (prefixes.some((prefix) => key.startsWith(prefix)) &&
|
|
4190
|
-
env[key] === undefined) {
|
|
4191
|
-
env[key] = process.env[key];
|
|
4192
|
-
}
|
|
4193
|
-
}
|
|
4194
4186
|
const parsed = Object.fromEntries(envFiles.flatMap((file) => {
|
|
4195
4187
|
const path = lookupFile(envDir, [file], {
|
|
4196
4188
|
pathOnly: true,
|
|
@@ -4219,6 +4211,13 @@ function loadEnv(mode, envDir, prefixes = 'VITE_') {
|
|
|
4219
4211
|
process.env.VITE_USER_NODE_ENV = value;
|
|
4220
4212
|
}
|
|
4221
4213
|
}
|
|
4214
|
+
// check if there are actual env variables starting with VITE_*
|
|
4215
|
+
// these are typically provided inline and should be prioritized
|
|
4216
|
+
for (const key in process.env) {
|
|
4217
|
+
if (prefixes.some((prefix) => key.startsWith(prefix))) {
|
|
4218
|
+
env[key] = process.env[key];
|
|
4219
|
+
}
|
|
4220
|
+
}
|
|
4222
4221
|
return env;
|
|
4223
4222
|
}
|
|
4224
4223
|
function resolveEnvPrefix({ envPrefix = 'VITE_' }) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Evan You",
|
|
@@ -69,17 +69,17 @@
|
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@ampproject/remapping": "^2.2.0",
|
|
72
|
-
"@babel/parser": "^7.19.
|
|
72
|
+
"@babel/parser": "^7.19.6",
|
|
73
73
|
"@babel/types": "^7.19.4",
|
|
74
74
|
"@jridgewell/trace-mapping": "^0.3.17",
|
|
75
|
-
"@rollup/plugin-alias": "^4.0.
|
|
75
|
+
"@rollup/plugin-alias": "^4.0.2",
|
|
76
76
|
"@rollup/plugin-commonjs": "^22.0.2",
|
|
77
77
|
"@rollup/plugin-dynamic-import-vars": "^1.4.4",
|
|
78
78
|
"@rollup/plugin-json": "^4.1.0",
|
|
79
79
|
"@rollup/plugin-node-resolve": "14.1.0",
|
|
80
80
|
"@rollup/plugin-typescript": "^8.5.0",
|
|
81
81
|
"@rollup/pluginutils": "^4.2.1",
|
|
82
|
-
"acorn": "^8.8.
|
|
82
|
+
"acorn": "^8.8.1",
|
|
83
83
|
"cac": "^6.7.14",
|
|
84
84
|
"chokidar": "^3.5.3",
|
|
85
85
|
"connect": "^3.7.0",
|
|
@@ -91,12 +91,11 @@
|
|
|
91
91
|
"dep-types": "link:./src/types",
|
|
92
92
|
"dotenv": "^14.3.2",
|
|
93
93
|
"dotenv-expand": "^5.1.0",
|
|
94
|
-
"es-module-lexer": "^1.0
|
|
94
|
+
"es-module-lexer": "^1.1.0",
|
|
95
95
|
"estree-walker": "^3.0.1",
|
|
96
96
|
"etag": "^1.8.1",
|
|
97
97
|
"fast-glob": "^3.2.12",
|
|
98
98
|
"http-proxy": "^1.18.1",
|
|
99
|
-
"import-meta-resolve": "^2.1.0",
|
|
100
99
|
"json5": "^2.2.1",
|
|
101
100
|
"launch-editor-middleware": "^2.6.0",
|
|
102
101
|
"magic-string": "^0.26.7",
|
|
@@ -122,7 +121,7 @@
|
|
|
122
121
|
"tslib": "^2.4.0",
|
|
123
122
|
"types": "link:./types",
|
|
124
123
|
"ufo": "^0.8.6",
|
|
125
|
-
"ws": "^8.
|
|
124
|
+
"ws": "^8.10.0"
|
|
126
125
|
},
|
|
127
126
|
"peerDependencies": {
|
|
128
127
|
"less": "*",
|