vite 3.0.0-beta.6 → 3.0.0-beta.7
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/dist/node/chunks/{dep-7018da1a.js → dep-5d9e5830.js} +1 -1
- package/dist/node/chunks/{dep-c7f6d0a5.js → dep-706f59ea.js} +3717 -3510
- package/dist/node/chunks/{dep-be0b8380.js → dep-d3bbad19.js} +1 -1
- package/dist/node/chunks/{dep-08aefb0c.js → dep-e8d443bf.js} +1 -1
- package/dist/node/cli.js +5 -5
- package/dist/node/constants.js +1 -1
- package/dist/node/index.d.ts +70 -59
- package/dist/node/index.js +1 -1
- package/dist/node-cjs/publicUtils.cjs +1 -1
- package/package.json +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 { y as picocolors, u as createLogger, e as resolveConfig } from './chunks/dep-706f59ea.js';
|
|
4
4
|
import { VERSION } from './constants.js';
|
|
5
5
|
import 'node:fs';
|
|
6
6
|
import 'node:path';
|
|
@@ -694,7 +694,7 @@ cli
|
|
|
694
694
|
.action(async (root, options) => {
|
|
695
695
|
// output structure is preserved even after bundling so require()
|
|
696
696
|
// is ok here
|
|
697
|
-
const { createServer } = await import('./chunks/dep-
|
|
697
|
+
const { createServer } = await import('./chunks/dep-706f59ea.js').then(function (n) { return n.E; });
|
|
698
698
|
try {
|
|
699
699
|
const server = await createServer({
|
|
700
700
|
root,
|
|
@@ -741,7 +741,7 @@ cli
|
|
|
741
741
|
.option('--emptyOutDir', `[boolean] force empty outDir when it's outside of root`)
|
|
742
742
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
|
743
743
|
.action(async (root, options) => {
|
|
744
|
-
const { build } = await import('./chunks/dep-
|
|
744
|
+
const { build } = await import('./chunks/dep-706f59ea.js').then(function (n) { return n.D; });
|
|
745
745
|
const buildOptions = cleanOptions(options);
|
|
746
746
|
try {
|
|
747
747
|
await build({
|
|
@@ -765,7 +765,7 @@ cli
|
|
|
765
765
|
.command('optimize [root]', 'pre-bundle dependencies')
|
|
766
766
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
|
767
767
|
.action(async (root, options) => {
|
|
768
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
|
768
|
+
const { optimizeDeps } = await import('./chunks/dep-706f59ea.js').then(function (n) { return n.C; });
|
|
769
769
|
try {
|
|
770
770
|
const config = await resolveConfig({
|
|
771
771
|
root,
|
|
@@ -788,7 +788,7 @@ cli
|
|
|
788
788
|
.option('--https', `[boolean] use TLS + HTTP/2`)
|
|
789
789
|
.option('--open [path]', `[boolean | string] open browser on startup`)
|
|
790
790
|
.action(async (root, options) => {
|
|
791
|
-
const { preview } = await import('./chunks/dep-
|
|
791
|
+
const { preview } = await import('./chunks/dep-706f59ea.js').then(function (n) { return n.F; });
|
|
792
792
|
try {
|
|
793
793
|
const server = await preview({
|
|
794
794
|
root,
|
package/dist/node/constants.js
CHANGED
package/dist/node/index.d.ts
CHANGED
|
@@ -326,7 +326,10 @@ export declare interface CommonServerOptions {
|
|
|
326
326
|
export declare interface ConfigEnv {
|
|
327
327
|
command: 'build' | 'serve';
|
|
328
328
|
mode: string;
|
|
329
|
-
|
|
329
|
+
/**
|
|
330
|
+
* @experimental
|
|
331
|
+
*/
|
|
332
|
+
ssrBuild?: boolean;
|
|
330
333
|
}
|
|
331
334
|
|
|
332
335
|
export declare namespace Connect {
|
|
@@ -507,48 +510,7 @@ export declare interface CustomPayload {
|
|
|
507
510
|
*/
|
|
508
511
|
export declare function defineConfig(config: UserConfigExport): UserConfigExport;
|
|
509
512
|
|
|
510
|
-
export declare interface
|
|
511
|
-
/**
|
|
512
|
-
* The main hash is determined by user config and dependency lockfiles.
|
|
513
|
-
* This is checked on server startup to avoid unnecessary re-bundles.
|
|
514
|
-
*/
|
|
515
|
-
hash: string;
|
|
516
|
-
/**
|
|
517
|
-
* The browser hash is determined by the main hash plus additional dependencies
|
|
518
|
-
* discovered at runtime. This is used to invalidate browser requests to
|
|
519
|
-
* optimized deps.
|
|
520
|
-
*/
|
|
521
|
-
browserHash: string;
|
|
522
|
-
/**
|
|
523
|
-
* Metadata for each already optimized dependency
|
|
524
|
-
*/
|
|
525
|
-
optimized: Record<string, OptimizedDepInfo>;
|
|
526
|
-
/**
|
|
527
|
-
* Metadata for non-entry optimized chunks and dynamic imports
|
|
528
|
-
*/
|
|
529
|
-
chunks: Record<string, OptimizedDepInfo>;
|
|
530
|
-
/**
|
|
531
|
-
* Metadata for each newly discovered dependency after processing
|
|
532
|
-
*/
|
|
533
|
-
discovered: Record<string, OptimizedDepInfo>;
|
|
534
|
-
/**
|
|
535
|
-
* OptimizedDepInfo list
|
|
536
|
-
*/
|
|
537
|
-
depInfoList: OptimizedDepInfo[];
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
export declare interface DepOptimizationOptions {
|
|
541
|
-
/**
|
|
542
|
-
* By default, Vite will crawl your `index.html` to detect dependencies that
|
|
543
|
-
* need to be pre-bundled. If `build.rollupOptions.input` is specified, Vite
|
|
544
|
-
* will crawl those entry points instead.
|
|
545
|
-
*
|
|
546
|
-
* If neither of these fit your needs, you can specify custom entries using
|
|
547
|
-
* this option - the value should be a fast-glob pattern or array of patterns
|
|
548
|
-
* (https://github.com/mrmlnc/fast-glob#basic-syntax) that are relative from
|
|
549
|
-
* vite project root. This will overwrite default entries inference.
|
|
550
|
-
*/
|
|
551
|
-
entries?: string | string[];
|
|
513
|
+
export declare interface DepOptimizationConfig {
|
|
552
514
|
/**
|
|
553
515
|
* Force optimize listed dependencies (must be resolvable import paths,
|
|
554
516
|
* cannot be globs).
|
|
@@ -595,12 +557,56 @@ export declare interface DepOptimizationOptions {
|
|
|
595
557
|
* @experimental
|
|
596
558
|
*/
|
|
597
559
|
disabled?: boolean | 'build' | 'dev';
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
export declare interface DepOptimizationMetadata {
|
|
563
|
+
/**
|
|
564
|
+
* The main hash is determined by user config and dependency lockfiles.
|
|
565
|
+
* This is checked on server startup to avoid unnecessary re-bundles.
|
|
566
|
+
*/
|
|
567
|
+
hash: string;
|
|
568
|
+
/**
|
|
569
|
+
* The browser hash is determined by the main hash plus additional dependencies
|
|
570
|
+
* discovered at runtime. This is used to invalidate browser requests to
|
|
571
|
+
* optimized deps.
|
|
572
|
+
*/
|
|
573
|
+
browserHash: string;
|
|
574
|
+
/**
|
|
575
|
+
* Metadata for each already optimized dependency
|
|
576
|
+
*/
|
|
577
|
+
optimized: Record<string, OptimizedDepInfo>;
|
|
578
|
+
/**
|
|
579
|
+
* Metadata for non-entry optimized chunks and dynamic imports
|
|
580
|
+
*/
|
|
581
|
+
chunks: Record<string, OptimizedDepInfo>;
|
|
582
|
+
/**
|
|
583
|
+
* Metadata for each newly discovered dependency after processing
|
|
584
|
+
*/
|
|
585
|
+
discovered: Record<string, OptimizedDepInfo>;
|
|
586
|
+
/**
|
|
587
|
+
* OptimizedDepInfo list
|
|
588
|
+
*/
|
|
589
|
+
depInfoList: OptimizedDepInfo[];
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
export declare type DepOptimizationOptions = DepOptimizationConfig & {
|
|
593
|
+
/**
|
|
594
|
+
* By default, Vite will crawl your `index.html` to detect dependencies that
|
|
595
|
+
* need to be pre-bundled. If `build.rollupOptions.input` is specified, Vite
|
|
596
|
+
* will crawl those entry points instead.
|
|
597
|
+
*
|
|
598
|
+
* If neither of these fit your needs, you can specify custom entries using
|
|
599
|
+
* this option - the value should be a fast-glob pattern or array of patterns
|
|
600
|
+
* (https://github.com/mrmlnc/fast-glob#basic-syntax) that are relative from
|
|
601
|
+
* vite project root. This will overwrite default entries inference.
|
|
602
|
+
*/
|
|
603
|
+
entries?: string | string[];
|
|
598
604
|
/**
|
|
599
605
|
* Force dep pre-optimization regardless of whether deps have changed.
|
|
600
606
|
* @experimental
|
|
601
607
|
*/
|
|
602
608
|
force?: boolean;
|
|
603
|
-
}
|
|
609
|
+
};
|
|
604
610
|
|
|
605
611
|
export declare interface DepOptimizationProcessing {
|
|
606
612
|
promise: Promise<void>;
|
|
@@ -621,7 +627,7 @@ export declare interface DepOptimizationResult {
|
|
|
621
627
|
export declare interface DepsOptimizer {
|
|
622
628
|
metadata: DepOptimizationMetadata;
|
|
623
629
|
scanProcessing?: Promise<void>;
|
|
624
|
-
registerMissingImport: (id: string, resolved: string
|
|
630
|
+
registerMissingImport: (id: string, resolved: string) => OptimizedDepInfo;
|
|
625
631
|
run: () => void;
|
|
626
632
|
isOptimizedDepFile: (id: string) => boolean;
|
|
627
633
|
isOptimizedDepUrl: (url: string) => boolean;
|
|
@@ -811,6 +817,8 @@ export declare interface FullReloadPayload {
|
|
|
811
817
|
path?: string
|
|
812
818
|
}
|
|
813
819
|
|
|
820
|
+
export declare function getDepOptimizationConfig(config: ResolvedConfig, ssr: boolean): DepOptimizationConfig;
|
|
821
|
+
|
|
814
822
|
export declare interface HmrContext {
|
|
815
823
|
file: string;
|
|
816
824
|
timestamp: number;
|
|
@@ -1206,13 +1214,12 @@ export declare interface InternalResolveOptions extends ResolveOptions {
|
|
|
1206
1214
|
isFromTsImporter?: boolean;
|
|
1207
1215
|
tryEsmOnly?: boolean;
|
|
1208
1216
|
scan?: boolean;
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
}) => DepsOptimizer | undefined;
|
|
1217
|
+
ssrOptimizeCheck?: boolean;
|
|
1218
|
+
getDepsOptimizer?: (ssr: boolean) => DepsOptimizer | undefined;
|
|
1212
1219
|
shouldExternalize?: (id: string) => boolean | undefined;
|
|
1213
1220
|
}
|
|
1214
1221
|
|
|
1215
|
-
export declare function isDepsOptimizerEnabled(config: ResolvedConfig): boolean;
|
|
1222
|
+
export declare function isDepsOptimizerEnabled(config: ResolvedConfig, ssr: boolean): boolean;
|
|
1216
1223
|
|
|
1217
1224
|
export declare interface JsonOptions {
|
|
1218
1225
|
/**
|
|
@@ -1235,14 +1242,6 @@ export declare interface KnownAsTypeMap {
|
|
|
1235
1242
|
}
|
|
1236
1243
|
|
|
1237
1244
|
export declare interface LegacyOptions {
|
|
1238
|
-
/**
|
|
1239
|
-
* Revert vite dev to the v2.9 strategy. Enable esbuild based deps scanner.
|
|
1240
|
-
*
|
|
1241
|
-
* @experimental
|
|
1242
|
-
* @deprecated
|
|
1243
|
-
* @default false
|
|
1244
|
-
*/
|
|
1245
|
-
devDepsScanner?: boolean;
|
|
1246
1245
|
/**
|
|
1247
1246
|
* Revert vite build to the v2.9 strategy. Disable esbuild deps optimization and adds `@rollup/plugin-commonjs`
|
|
1248
1247
|
*
|
|
@@ -1678,7 +1677,7 @@ export declare type ResolvedConfig = Readonly<Omit<UserConfig, 'plugins' | 'asse
|
|
|
1678
1677
|
server: ResolvedServerOptions;
|
|
1679
1678
|
build: ResolvedBuildOptions;
|
|
1680
1679
|
preview: ResolvedPreviewOptions;
|
|
1681
|
-
ssr: ResolvedSSROptions
|
|
1680
|
+
ssr: ResolvedSSROptions;
|
|
1682
1681
|
assetsInclude: (file: string) => boolean;
|
|
1683
1682
|
logger: Logger;
|
|
1684
1683
|
createResolver: (options?: Partial<InternalResolveOptions>) => ResolveFn;
|
|
@@ -1700,6 +1699,7 @@ export declare interface ResolvedServerOptions extends ServerOptions {
|
|
|
1700
1699
|
export declare interface ResolvedSSROptions extends SSROptions {
|
|
1701
1700
|
target: SSRTarget;
|
|
1702
1701
|
format: SSRFormat;
|
|
1702
|
+
optimizeDeps: SsrDepOptimizationOptions;
|
|
1703
1703
|
}
|
|
1704
1704
|
|
|
1705
1705
|
export declare type ResolvedUrl = [
|
|
@@ -2013,11 +2013,13 @@ export declare class SplitVendorChunkCache {
|
|
|
2013
2013
|
|
|
2014
2014
|
export declare function splitVendorChunkPlugin(): Plugin_2;
|
|
2015
2015
|
|
|
2016
|
+
export declare type SsrDepOptimizationOptions = DepOptimizationConfig;
|
|
2017
|
+
|
|
2016
2018
|
export declare type SSRFormat = 'esm' | 'cjs';
|
|
2017
2019
|
|
|
2018
2020
|
export declare interface SSROptions {
|
|
2019
|
-
external?: string[];
|
|
2020
2021
|
noExternal?: string | RegExp | (string | RegExp)[] | true;
|
|
2022
|
+
external?: string[];
|
|
2021
2023
|
/**
|
|
2022
2024
|
* Define the target for the ssr build. The browser field in package.json
|
|
2023
2025
|
* is ignored for node but used if webworker is the target
|
|
@@ -2032,6 +2034,15 @@ export declare interface SSROptions {
|
|
|
2032
2034
|
* @experimental
|
|
2033
2035
|
*/
|
|
2034
2036
|
format?: SSRFormat;
|
|
2037
|
+
/**
|
|
2038
|
+
* Control over which dependencies are optimized during SSR and esbuild options
|
|
2039
|
+
* During build:
|
|
2040
|
+
* no external CJS dependencies are optimized by default
|
|
2041
|
+
* During dev:
|
|
2042
|
+
* explicit no external CJS dependencies are optimized by default
|
|
2043
|
+
* @experimental
|
|
2044
|
+
*/
|
|
2045
|
+
optimizeDeps?: SsrDepOptimizationOptions;
|
|
2035
2046
|
}
|
|
2036
2047
|
|
|
2037
2048
|
export declare type SSRTarget = 'node' | 'webworker';
|
package/dist/node/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as build,
|
|
1
|
+
export { b as build, k as createFilter, u as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, h as getDepOptimizationConfig, i as isDepsOptimizerEnabled, l as loadConfigFromFile, w as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, p as preview, g as resolveBaseUrl, e as resolveConfig, x as resolveEnvPrefix, a as resolvePackageData, r as resolvePackageEntry, v as searchForWorkspaceRoot, q as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-706f59ea.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';
|
|
@@ -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.0.0-beta.
|
|
34
|
+
var version = "3.0.0-beta.7";
|
|
35
35
|
|
|
36
36
|
const VERSION = version;
|
|
37
37
|
const VITE_PACKAGE_DIR = path$3.resolve(
|