vite 5.0.0-beta.1 → 5.0.0-beta.3
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 +36 -2
- package/client.d.ts +8 -56
- package/dist/client/client.mjs.map +1 -1
- package/dist/client/env.mjs.map +1 -1
- package/dist/node/chunks/{dep-c457d7ce.js → dep-68c42983.js} +1 -1
- package/dist/node/chunks/{dep-6db0c752.js → dep-9586b1f1.js} +1 -1
- package/dist/node/chunks/{dep-e31699fa.js → dep-dc9999ab.js} +1978 -1431
- package/dist/node/cli.js +12 -8
- package/dist/node/index.d.ts +7 -58
- package/dist/node/index.js +4 -3
- package/dist/node-cjs/publicUtils.cjs +364 -82
- package/index.cjs +14 -0
- package/index.d.cts +6 -0
- package/package.json +36 -29
package/dist/node/cli.js
CHANGED
|
@@ -2,7 +2,7 @@ import path from 'node:path';
|
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import { performance } from 'node:perf_hooks';
|
|
4
4
|
import { EventEmitter } from 'events';
|
|
5
|
-
import { C as colors, x as createLogger, h as resolveConfig } from './chunks/dep-
|
|
5
|
+
import { C as colors, x as createLogger, h as resolveConfig } from './chunks/dep-dc9999ab.js';
|
|
6
6
|
import { VERSION } from './constants.js';
|
|
7
7
|
import 'node:fs/promises';
|
|
8
8
|
import 'node:url';
|
|
@@ -27,19 +27,20 @@ import 'node:dns';
|
|
|
27
27
|
import 'crypto';
|
|
28
28
|
import 'node:buffer';
|
|
29
29
|
import 'module';
|
|
30
|
+
import 'rollup';
|
|
30
31
|
import 'node:assert';
|
|
31
32
|
import 'node:process';
|
|
32
33
|
import 'node:v8';
|
|
33
|
-
import 'rollup';
|
|
34
|
-
import 'worker_threads';
|
|
35
34
|
import 'node:http';
|
|
36
35
|
import 'node:https';
|
|
37
36
|
import 'zlib';
|
|
38
37
|
import 'buffer';
|
|
39
38
|
import 'https';
|
|
40
39
|
import 'tls';
|
|
40
|
+
import 'worker_threads';
|
|
41
41
|
import 'querystring';
|
|
42
42
|
import 'node:readline';
|
|
43
|
+
import 'node:events';
|
|
43
44
|
import 'node:zlib';
|
|
44
45
|
|
|
45
46
|
function toArr(any) {
|
|
@@ -758,7 +759,7 @@ cli
|
|
|
758
759
|
filterDuplicateOptions(options);
|
|
759
760
|
// output structure is preserved even after bundling so require()
|
|
760
761
|
// is ok here
|
|
761
|
-
const { createServer } = await import('./chunks/dep-
|
|
762
|
+
const { createServer } = await import('./chunks/dep-dc9999ab.js').then(function (n) { return n.H; });
|
|
762
763
|
try {
|
|
763
764
|
const server = await createServer({
|
|
764
765
|
root,
|
|
@@ -779,7 +780,10 @@ cli
|
|
|
779
780
|
const startupDurationString = viteStartTime
|
|
780
781
|
? colors.dim(`ready in ${colors.reset(colors.bold(Math.ceil(performance.now() - viteStartTime)))} ms`)
|
|
781
782
|
: '';
|
|
782
|
-
info(`\n ${colors.green(`${colors.bold('VITE')} v${VERSION}`)} ${startupDurationString}\n`, {
|
|
783
|
+
info(`\n ${colors.green(`${colors.bold('VITE')} v${VERSION}`)} ${startupDurationString}\n`, {
|
|
784
|
+
clear: !server.config.logger.hasWarned &&
|
|
785
|
+
!globalThis.__vite_cjs_skip_clear_screen,
|
|
786
|
+
});
|
|
783
787
|
server.printUrls();
|
|
784
788
|
server.bindCLIShortcuts({
|
|
785
789
|
print: true,
|
|
@@ -836,7 +840,7 @@ cli
|
|
|
836
840
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
|
837
841
|
.action(async (root, options) => {
|
|
838
842
|
filterDuplicateOptions(options);
|
|
839
|
-
const { build } = await import('./chunks/dep-
|
|
843
|
+
const { build } = await import('./chunks/dep-dc9999ab.js').then(function (n) { return n.G; });
|
|
840
844
|
const buildOptions = cleanOptions(options);
|
|
841
845
|
try {
|
|
842
846
|
await build({
|
|
@@ -864,7 +868,7 @@ cli
|
|
|
864
868
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
|
865
869
|
.action(async (root, options) => {
|
|
866
870
|
filterDuplicateOptions(options);
|
|
867
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
|
871
|
+
const { optimizeDeps } = await import('./chunks/dep-dc9999ab.js').then(function (n) { return n.F; });
|
|
868
872
|
try {
|
|
869
873
|
const config = await resolveConfig({
|
|
870
874
|
root,
|
|
@@ -891,7 +895,7 @@ cli
|
|
|
891
895
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
|
892
896
|
.action(async (root, options) => {
|
|
893
897
|
filterDuplicateOptions(options);
|
|
894
|
-
const { preview } = await import('./chunks/dep-
|
|
898
|
+
const { preview } = await import('./chunks/dep-dc9999ab.js').then(function (n) { return n.I; });
|
|
895
899
|
try {
|
|
896
900
|
const server = await preview({
|
|
897
901
|
root,
|
package/dist/node/index.d.ts
CHANGED
|
@@ -256,7 +256,7 @@ export declare interface BuildOptions {
|
|
|
256
256
|
*/
|
|
257
257
|
copyPublicDir?: boolean;
|
|
258
258
|
/**
|
|
259
|
-
* Whether to emit a manifest.json under assets dir to map hash-less filenames
|
|
259
|
+
* Whether to emit a .vite/manifest.json under assets dir to map hash-less filenames
|
|
260
260
|
* to their hashed versions. Useful when you want to generate your own HTML
|
|
261
261
|
* instead of using the one generated by Vite.
|
|
262
262
|
*
|
|
@@ -296,7 +296,6 @@ export declare interface BuildOptions {
|
|
|
296
296
|
ssrManifest?: boolean | string;
|
|
297
297
|
/**
|
|
298
298
|
* Emit assets during SSR.
|
|
299
|
-
* @experimental
|
|
300
299
|
* @default false
|
|
301
300
|
*/
|
|
302
301
|
ssrEmitAssets?: boolean;
|
|
@@ -729,8 +728,6 @@ export declare interface DepsOptimizer {
|
|
|
729
728
|
}
|
|
730
729
|
|
|
731
730
|
declare interface Drafts {
|
|
732
|
-
/** Whether to enable CSS nesting. */
|
|
733
|
-
nesting?: boolean,
|
|
734
731
|
/** Whether to enable @custom-media rules. */
|
|
735
732
|
customMedia?: boolean
|
|
736
733
|
}
|
|
@@ -792,32 +789,6 @@ export declare type ExportsData = {
|
|
|
792
789
|
jsxLoader?: boolean;
|
|
793
790
|
};
|
|
794
791
|
|
|
795
|
-
declare const enum Features {
|
|
796
|
-
Nesting = 1,
|
|
797
|
-
NotSelectorList = 2,
|
|
798
|
-
DirSelector = 4,
|
|
799
|
-
LangSelectorList = 8,
|
|
800
|
-
IsSelector = 16,
|
|
801
|
-
TextDecorationThicknessPercent = 32,
|
|
802
|
-
MediaIntervalSyntax = 64,
|
|
803
|
-
MediaRangeSyntax = 128,
|
|
804
|
-
CustomMediaQueries = 256,
|
|
805
|
-
ClampFunction = 512,
|
|
806
|
-
ColorFunction = 1024,
|
|
807
|
-
OklabColors = 2048,
|
|
808
|
-
LabColors = 4096,
|
|
809
|
-
P3Colors = 8192,
|
|
810
|
-
HexAlphaColors = 16384,
|
|
811
|
-
SpaceSeparatedColorNotation = 32768,
|
|
812
|
-
FontFamilySystemUi = 65536,
|
|
813
|
-
DoublePositionGradients = 131072,
|
|
814
|
-
VendorPrefixes = 262144,
|
|
815
|
-
LogicalProperties = 524288,
|
|
816
|
-
Selectors = 31,
|
|
817
|
-
MediaQueries = 448,
|
|
818
|
-
Colors = 64512,
|
|
819
|
-
}
|
|
820
|
-
|
|
821
792
|
export declare interface FileSystemServeOptions {
|
|
822
793
|
/**
|
|
823
794
|
* Strictly restrict file accessing outside of allowing paths.
|
|
@@ -1298,14 +1269,6 @@ export declare interface JsonOptions {
|
|
|
1298
1269
|
export { KnownAsTypeMap }
|
|
1299
1270
|
|
|
1300
1271
|
export declare interface LegacyOptions {
|
|
1301
|
-
/**
|
|
1302
|
-
* Revert vite build --ssr to the v2.9 strategy. Use CJS SSR build and v2.9 externalization heuristics
|
|
1303
|
-
*
|
|
1304
|
-
* @experimental
|
|
1305
|
-
* @deprecated
|
|
1306
|
-
* @default false
|
|
1307
|
-
*/
|
|
1308
|
-
buildSsrCjsExternalHeuristics?: boolean;
|
|
1309
1272
|
}
|
|
1310
1273
|
|
|
1311
1274
|
export declare type LibraryFormats = 'es' | 'cjs' | 'umd' | 'iife';
|
|
@@ -1339,8 +1302,8 @@ export declare interface LibraryOptions {
|
|
|
1339
1302
|
*/
|
|
1340
1303
|
export declare type LightningCSSOptions = {
|
|
1341
1304
|
targets?: Targets
|
|
1342
|
-
include?:
|
|
1343
|
-
exclude?:
|
|
1305
|
+
include?: number
|
|
1306
|
+
exclude?: number
|
|
1344
1307
|
drafts?: Drafts
|
|
1345
1308
|
nonStandard?: NonStandard
|
|
1346
1309
|
pseudoClasses?: PseudoClasses
|
|
@@ -1560,7 +1523,7 @@ export declare interface PackageData {
|
|
|
1560
1523
|
* If a plugin should be applied only for server or build, a function format
|
|
1561
1524
|
* config file can be used to conditional determine the plugins to use.
|
|
1562
1525
|
*/
|
|
1563
|
-
declare interface Plugin_2 extends Plugin_3 {
|
|
1526
|
+
declare interface Plugin_2<A = any> extends Plugin_3<A> {
|
|
1564
1527
|
/**
|
|
1565
1528
|
* Enforce plugin invocation tier similar to webpack loaders.
|
|
1566
1529
|
*
|
|
@@ -1586,7 +1549,7 @@ declare interface Plugin_2 extends Plugin_3 {
|
|
|
1586
1549
|
* Note: User plugins are resolved before running this hook so injecting other
|
|
1587
1550
|
* plugins inside the `config` hook will have no effect.
|
|
1588
1551
|
*/
|
|
1589
|
-
config?: ObjectHook<(this: void, config: UserConfig, env: ConfigEnv) => UserConfig | null | void | Promise<UserConfig | null | void>>;
|
|
1552
|
+
config?: ObjectHook<(this: void, config: UserConfig, env: ConfigEnv) => Omit<UserConfig, 'plugins'> | null | void | Promise<Omit<UserConfig, 'plugins'> | null | void>>;
|
|
1590
1553
|
/**
|
|
1591
1554
|
* Use this hook to read and store the final resolved vite config.
|
|
1592
1555
|
*/
|
|
@@ -1861,7 +1824,6 @@ export declare interface ResolvedServerUrls {
|
|
|
1861
1824
|
|
|
1862
1825
|
export declare interface ResolvedSSROptions extends SSROptions {
|
|
1863
1826
|
target: SSRTarget;
|
|
1864
|
-
format: SSRFormat;
|
|
1865
1827
|
optimizeDeps: SsrDepOptimizationOptions;
|
|
1866
1828
|
}
|
|
1867
1829
|
|
|
@@ -2196,10 +2158,10 @@ export declare interface ServerOptions extends CommonServerOptions {
|
|
|
2196
2158
|
*/
|
|
2197
2159
|
hmr?: HmrOptions | boolean;
|
|
2198
2160
|
/**
|
|
2199
|
-
* chokidar watch options
|
|
2161
|
+
* chokidar watch options or null to disable FS watching
|
|
2200
2162
|
* https://github.com/paulmillr/chokidar#api
|
|
2201
2163
|
*/
|
|
2202
|
-
watch?: WatchOptions;
|
|
2164
|
+
watch?: WatchOptions | null;
|
|
2203
2165
|
/**
|
|
2204
2166
|
* Create Vite dev server to be used as a middleware in an existing server
|
|
2205
2167
|
* @default false
|
|
@@ -2254,8 +2216,6 @@ export declare function splitVendorChunkPlugin(): Plugin_2;
|
|
|
2254
2216
|
|
|
2255
2217
|
export declare type SsrDepOptimizationOptions = DepOptimizationConfig;
|
|
2256
2218
|
|
|
2257
|
-
export declare type SSRFormat = 'esm' | 'cjs';
|
|
2258
|
-
|
|
2259
2219
|
export declare interface SSROptions {
|
|
2260
2220
|
noExternal?: string | RegExp | (string | RegExp)[] | true;
|
|
2261
2221
|
external?: string[];
|
|
@@ -2265,16 +2225,6 @@ export declare interface SSROptions {
|
|
|
2265
2225
|
* @default 'node'
|
|
2266
2226
|
*/
|
|
2267
2227
|
target?: SSRTarget;
|
|
2268
|
-
/**
|
|
2269
|
-
* Define the format for the ssr build. Since Vite v3 the SSR build generates ESM by default.
|
|
2270
|
-
* `'cjs'` can be selected to generate a CJS build, but it isn't recommended. This option is
|
|
2271
|
-
* left marked as experimental to give users more time to update to ESM. CJS builds requires
|
|
2272
|
-
* complex externalization heuristics that aren't present in the ESM format.
|
|
2273
|
-
* @experimental
|
|
2274
|
-
* @deprecated
|
|
2275
|
-
* @default 'esm'
|
|
2276
|
-
*/
|
|
2277
|
-
format?: SSRFormat;
|
|
2278
2228
|
/**
|
|
2279
2229
|
* Control over which dependencies are optimized during SSR and esbuild options
|
|
2280
2230
|
* During build:
|
|
@@ -2803,7 +2753,6 @@ export declare interface ViteDevServer {
|
|
|
2803
2753
|
*/
|
|
2804
2754
|
openBrowser(): void;
|
|
2805
2755
|
/* Excluded from this release type: _importGlobMap */
|
|
2806
|
-
/* Excluded from this release type: _ssrExternals */
|
|
2807
2756
|
/* Excluded from this release type: _restartPromise */
|
|
2808
2757
|
/* Excluded from this release type: _forceOptimizeOnRestart */
|
|
2809
2758
|
/* Excluded from this release type: _pendingRequests */
|
package/dist/node/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as isInNodeModules } from './chunks/dep-
|
|
2
|
-
export { b as build, e as buildErrorMessage, v as createFilter, x as createLogger, c as createServer, g as defineConfig, f as formatPostcssSourceMap, k as getDepOptimizationConfig, m as isDepsOptimizerEnabled, z as isFileServingAllowed, l as loadConfigFromFile, A as loadEnv, u as mergeAlias, q as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, j as resolveBaseUrl, h as resolveConfig, B as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, y as searchForWorkspaceRoot, w as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
|
1
|
+
import { i as isInNodeModules } from './chunks/dep-dc9999ab.js';
|
|
2
|
+
export { b as build, e as buildErrorMessage, v as createFilter, x as createLogger, c as createServer, g as defineConfig, f as formatPostcssSourceMap, k as getDepOptimizationConfig, m as isDepsOptimizerEnabled, z as isFileServingAllowed, l as loadConfigFromFile, A as loadEnv, u as mergeAlias, q as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, j as resolveBaseUrl, h as resolveConfig, B as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, y as searchForWorkspaceRoot, w as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-dc9999ab.js';
|
|
3
3
|
export { VERSION as version } from './constants.js';
|
|
4
4
|
export { version as esbuildVersion } from 'esbuild';
|
|
5
5
|
export { VERSION as rollupVersion } from 'rollup';
|
|
@@ -32,15 +32,16 @@ import 'module';
|
|
|
32
32
|
import 'node:assert';
|
|
33
33
|
import 'node:process';
|
|
34
34
|
import 'node:v8';
|
|
35
|
-
import 'worker_threads';
|
|
36
35
|
import 'node:http';
|
|
37
36
|
import 'node:https';
|
|
38
37
|
import 'zlib';
|
|
39
38
|
import 'buffer';
|
|
40
39
|
import 'https';
|
|
41
40
|
import 'tls';
|
|
41
|
+
import 'worker_threads';
|
|
42
42
|
import 'querystring';
|
|
43
43
|
import 'node:readline';
|
|
44
|
+
import 'node:events';
|
|
44
45
|
import 'node:zlib';
|
|
45
46
|
|
|
46
47
|
// This file will be built for both ESM and CJS. Avoid relying on other modules as possible.
|