vite 3.0.0-beta.4 → 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/LICENSE.md +1 -1
- package/dist/node/chunks/{dep-3856e872.js → dep-41eb528c.js} +4 -4
- package/dist/node/chunks/{dep-02aa3d4a.js → dep-5d9e5830.js} +1 -1
- package/dist/node/chunks/{dep-07df4e90.js → dep-706f59ea.js} +4294 -3985
- package/dist/node/chunks/{dep-30bcfc51.js → dep-d3bbad19.js} +10 -10
- package/dist/node/chunks/{dep-d55123c0.js → dep-e8d443bf.js} +2 -2
- package/dist/node/cli.js +6 -6
- package/dist/node/constants.js +12 -3
- package/dist/node/index.d.ts +98 -95
- package/dist/node/index.js +2 -2
- package/dist/node-cjs/publicUtils.cjs +1 -1
- package/package.json +9 -8
- package/src/client/tsconfig.json +0 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import require$$0 from 'postcss';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import require$$0$1 from 'postcss';
|
|
2
|
+
import { z as commonjsGlobal } from './dep-706f59ea.js';
|
|
3
|
+
import require$$0 from 'path';
|
|
4
4
|
import require$$5 from 'crypto';
|
|
5
5
|
import require$$0__default from 'fs';
|
|
6
|
-
import require$$0$
|
|
6
|
+
import require$$0$2 from 'util';
|
|
7
7
|
import { l as lib$1 } from './dep-07a79996.js';
|
|
8
8
|
|
|
9
9
|
import { fileURLToPath as __cjs_fileURLToPath } from 'node:url';
|
|
@@ -1220,7 +1220,7 @@ function getHashDigest$1(buffer, algorithm, digestType, maxLength) {
|
|
|
1220
1220
|
|
|
1221
1221
|
var getHashDigest_1 = getHashDigest$1;
|
|
1222
1222
|
|
|
1223
|
-
const path$1 =
|
|
1223
|
+
const path$1 = require$$0;
|
|
1224
1224
|
const getHashDigest = getHashDigest_1;
|
|
1225
1225
|
|
|
1226
1226
|
function interpolateName$1(loaderContext, name, options = {}) {
|
|
@@ -1336,7 +1336,7 @@ function interpolateName$1(loaderContext, name, options = {}) {
|
|
|
1336
1336
|
var interpolateName_1 = interpolateName$1;
|
|
1337
1337
|
|
|
1338
1338
|
var interpolateName = interpolateName_1;
|
|
1339
|
-
var path =
|
|
1339
|
+
var path = require$$0;
|
|
1340
1340
|
|
|
1341
1341
|
/**
|
|
1342
1342
|
* @param {string} pattern
|
|
@@ -1520,7 +1520,7 @@ Object.defineProperty(loader, "__esModule", {
|
|
|
1520
1520
|
value: true
|
|
1521
1521
|
});
|
|
1522
1522
|
|
|
1523
|
-
var _postcss$1 = require$$0;
|
|
1523
|
+
var _postcss$1 = require$$0$1;
|
|
1524
1524
|
|
|
1525
1525
|
var _postcss2$1 = _interopRequireDefault$5(_postcss$1);
|
|
1526
1526
|
|
|
@@ -1528,7 +1528,7 @@ var _fs$1 = require$$0__default;
|
|
|
1528
1528
|
|
|
1529
1529
|
var _fs2 = _interopRequireDefault$5(_fs$1);
|
|
1530
1530
|
|
|
1531
|
-
var _path =
|
|
1531
|
+
var _path = require$$0;
|
|
1532
1532
|
|
|
1533
1533
|
var _path2 = _interopRequireDefault$5(_path);
|
|
1534
1534
|
|
|
@@ -3153,7 +3153,7 @@ var attribute$1 = {};
|
|
|
3153
3153
|
* For Node.js, simply re-export the core `util.deprecate` function.
|
|
3154
3154
|
*/
|
|
3155
3155
|
|
|
3156
|
-
var node = require$$0$
|
|
3156
|
+
var node = require$$0$2.deprecate;
|
|
3157
3157
|
|
|
3158
3158
|
(function (exports) {
|
|
3159
3159
|
|
|
@@ -7355,7 +7355,7 @@ function isValidBehaviour(behaviour) {
|
|
|
7355
7355
|
return Object.keys(behaviours).map(key => behaviours[key]).indexOf(behaviour) > -1;
|
|
7356
7356
|
}
|
|
7357
7357
|
|
|
7358
|
-
var _postcss = require$$0;
|
|
7358
|
+
var _postcss = require$$0$1;
|
|
7359
7359
|
|
|
7360
7360
|
var _postcss2 = _interopRequireDefault(_postcss);
|
|
7361
7361
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z as commonjsGlobal } from './dep-706f59ea.js';
|
|
2
2
|
import require$$5 from 'crypto';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:path';
|
|
@@ -25,7 +25,6 @@ import 'node:dns';
|
|
|
25
25
|
import 'resolve';
|
|
26
26
|
import '../constants.js';
|
|
27
27
|
import 'buffer';
|
|
28
|
-
import 'querystring';
|
|
29
28
|
import 'module';
|
|
30
29
|
import 'zlib';
|
|
31
30
|
import 'https';
|
|
@@ -33,6 +32,7 @@ import 'tls';
|
|
|
33
32
|
import 'node:http';
|
|
34
33
|
import 'node:https';
|
|
35
34
|
import 'worker_threads';
|
|
35
|
+
import 'querystring';
|
|
36
36
|
import 'readline';
|
|
37
37
|
import 'node:child_process';
|
|
38
38
|
import 'node:zlib';
|
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';
|
|
@@ -25,7 +25,6 @@ import 'node:dns';
|
|
|
25
25
|
import 'resolve';
|
|
26
26
|
import 'crypto';
|
|
27
27
|
import 'buffer';
|
|
28
|
-
import 'querystring';
|
|
29
28
|
import 'module';
|
|
30
29
|
import 'zlib';
|
|
31
30
|
import 'https';
|
|
@@ -33,6 +32,7 @@ import 'tls';
|
|
|
33
32
|
import 'node:http';
|
|
34
33
|
import 'node:https';
|
|
35
34
|
import 'worker_threads';
|
|
35
|
+
import 'querystring';
|
|
36
36
|
import 'readline';
|
|
37
37
|
import 'node:child_process';
|
|
38
38
|
import 'node:zlib';
|
|
@@ -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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path, { resolve } from 'node:path';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
3
|
|
|
4
|
-
var version = "3.0.0-beta.
|
|
4
|
+
var version = "3.0.0-beta.7";
|
|
5
5
|
|
|
6
6
|
const VERSION = version;
|
|
7
7
|
const DEFAULT_MAIN_FIELDS = [
|
|
@@ -9,6 +9,15 @@ const DEFAULT_MAIN_FIELDS = [
|
|
|
9
9
|
'jsnext:main',
|
|
10
10
|
'jsnext'
|
|
11
11
|
];
|
|
12
|
+
// Support browserslist
|
|
13
|
+
// "defaults and supports es6-module and supports es6-module-dynamic-import",
|
|
14
|
+
const ESBUILD_MODULES_TARGET = [
|
|
15
|
+
'es2020',
|
|
16
|
+
'edge88',
|
|
17
|
+
'firefox78',
|
|
18
|
+
'chrome87',
|
|
19
|
+
'safari13' // transpile nullish coalescing
|
|
20
|
+
];
|
|
12
21
|
const DEFAULT_EXTENSIONS = [
|
|
13
22
|
'.mjs',
|
|
14
23
|
'.js',
|
|
@@ -26,7 +35,7 @@ const DEFAULT_CONFIG_FILES = [
|
|
|
26
35
|
'vite.config.cts'
|
|
27
36
|
];
|
|
28
37
|
const JS_TYPES_RE = /\.(?:j|t)sx?$|\.mjs$/;
|
|
29
|
-
const OPTIMIZABLE_ENTRY_RE = /\.(?:m?js|ts)$/;
|
|
38
|
+
const OPTIMIZABLE_ENTRY_RE = /\.(?:(m|c)?js|ts)$/;
|
|
30
39
|
const SPECIAL_QUERY_RE = /[\?&](?:worker|sharedworker|raw|url)\b/;
|
|
31
40
|
/**
|
|
32
41
|
* Prefix for resolved fs paths, since windows paths may not be valid as URLs.
|
|
@@ -106,4 +115,4 @@ const wildcardHosts = new Set([
|
|
|
106
115
|
'0000:0000:0000:0000:0000:0000:0000:0000'
|
|
107
116
|
]);
|
|
108
117
|
|
|
109
|
-
export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES, DEFAULT_EXTENSIONS, DEFAULT_MAIN_FIELDS, DEP_VERSION_RE, ENV_ENTRY, ENV_PUBLIC_PATH, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, NULL_BYTE_PLACEHOLDER, OPTIMIZABLE_ENTRY_RE, SPECIAL_QUERY_RE, VALID_ID_PREFIX, VERSION, VITE_PACKAGE_DIR, loopbackHosts, wildcardHosts };
|
|
118
|
+
export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES, DEFAULT_EXTENSIONS, DEFAULT_MAIN_FIELDS, DEP_VERSION_RE, ENV_ENTRY, ENV_PUBLIC_PATH, ESBUILD_MODULES_TARGET, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, NULL_BYTE_PLACEHOLDER, OPTIMIZABLE_ENTRY_RE, SPECIAL_QUERY_RE, VALID_ID_PREFIX, VERSION, VITE_PACKAGE_DIR, loopbackHosts, wildcardHosts };
|
package/dist/node/index.d.ts
CHANGED
|
@@ -104,26 +104,6 @@ export declare interface AwaitWriteFinishOptions {
|
|
|
104
104
|
*/
|
|
105
105
|
export declare function build(inlineConfig?: InlineConfig): Promise<RollupOutput | RollupOutput[] | RollupWatcher>;
|
|
106
106
|
|
|
107
|
-
export declare type BuildAdvancedBaseConfig = BuildAdvancedBaseOptions & {
|
|
108
|
-
/**
|
|
109
|
-
* Base for assets and public files in case they should be different
|
|
110
|
-
*/
|
|
111
|
-
assets?: string | BuildAdvancedBaseOptions;
|
|
112
|
-
public?: string | BuildAdvancedBaseOptions;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
export declare interface BuildAdvancedBaseOptions {
|
|
116
|
-
/**
|
|
117
|
-
* Relative base. If true, every generated URL is relative and the dist folder
|
|
118
|
-
* can be deployed to any base or subdomain. Use this option when the base
|
|
119
|
-
* is unkown at build time
|
|
120
|
-
* @default false
|
|
121
|
-
*/
|
|
122
|
-
relative?: boolean;
|
|
123
|
-
url?: string;
|
|
124
|
-
runtime?: (filename: string) => string;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
107
|
export declare interface BuildOptions {
|
|
128
108
|
/**
|
|
129
109
|
* Compatibility transform target. The transform is performed with esbuild
|
|
@@ -346,6 +326,10 @@ export declare interface CommonServerOptions {
|
|
|
346
326
|
export declare interface ConfigEnv {
|
|
347
327
|
command: 'build' | 'serve';
|
|
348
328
|
mode: string;
|
|
329
|
+
/**
|
|
330
|
+
* @experimental
|
|
331
|
+
*/
|
|
332
|
+
ssrBuild?: boolean;
|
|
349
333
|
}
|
|
350
334
|
|
|
351
335
|
export declare namespace Connect {
|
|
@@ -495,7 +479,7 @@ export declare interface CSSOptions {
|
|
|
495
479
|
modules?: CSSModulesOptions | false;
|
|
496
480
|
preprocessorOptions?: Record<string, any>;
|
|
497
481
|
postcss?: string | (PostCSS.ProcessOptions & {
|
|
498
|
-
plugins?: PostCSS.
|
|
482
|
+
plugins?: PostCSS.AcceptedPlugin[];
|
|
499
483
|
});
|
|
500
484
|
/**
|
|
501
485
|
* Enables css sourcemaps during dev
|
|
@@ -526,48 +510,7 @@ export declare interface CustomPayload {
|
|
|
526
510
|
*/
|
|
527
511
|
export declare function defineConfig(config: UserConfigExport): UserConfigExport;
|
|
528
512
|
|
|
529
|
-
export declare interface
|
|
530
|
-
/**
|
|
531
|
-
* The main hash is determined by user config and dependency lockfiles.
|
|
532
|
-
* This is checked on server startup to avoid unnecessary re-bundles.
|
|
533
|
-
*/
|
|
534
|
-
hash: string;
|
|
535
|
-
/**
|
|
536
|
-
* The browser hash is determined by the main hash plus additional dependencies
|
|
537
|
-
* discovered at runtime. This is used to invalidate browser requests to
|
|
538
|
-
* optimized deps.
|
|
539
|
-
*/
|
|
540
|
-
browserHash: string;
|
|
541
|
-
/**
|
|
542
|
-
* Metadata for each already optimized dependency
|
|
543
|
-
*/
|
|
544
|
-
optimized: Record<string, OptimizedDepInfo>;
|
|
545
|
-
/**
|
|
546
|
-
* Metadata for non-entry optimized chunks and dynamic imports
|
|
547
|
-
*/
|
|
548
|
-
chunks: Record<string, OptimizedDepInfo>;
|
|
549
|
-
/**
|
|
550
|
-
* Metadata for each newly discovered dependency after processing
|
|
551
|
-
*/
|
|
552
|
-
discovered: Record<string, OptimizedDepInfo>;
|
|
553
|
-
/**
|
|
554
|
-
* OptimizedDepInfo list
|
|
555
|
-
*/
|
|
556
|
-
depInfoList: OptimizedDepInfo[];
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
export declare interface DepOptimizationOptions {
|
|
560
|
-
/**
|
|
561
|
-
* By default, Vite will crawl your `index.html` to detect dependencies that
|
|
562
|
-
* need to be pre-bundled. If `build.rollupOptions.input` is specified, Vite
|
|
563
|
-
* will crawl those entry points instead.
|
|
564
|
-
*
|
|
565
|
-
* If neither of these fit your needs, you can specify custom entries using
|
|
566
|
-
* this option - the value should be a fast-glob pattern or array of patterns
|
|
567
|
-
* (https://github.com/mrmlnc/fast-glob#basic-syntax) that are relative from
|
|
568
|
-
* vite project root. This will overwrite default entries inference.
|
|
569
|
-
*/
|
|
570
|
-
entries?: string | string[];
|
|
513
|
+
export declare interface DepOptimizationConfig {
|
|
571
514
|
/**
|
|
572
515
|
* Force optimize listed dependencies (must be resolvable import paths,
|
|
573
516
|
* cannot be globs).
|
|
@@ -614,12 +557,56 @@ export declare interface DepOptimizationOptions {
|
|
|
614
557
|
* @experimental
|
|
615
558
|
*/
|
|
616
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[];
|
|
617
604
|
/**
|
|
618
605
|
* Force dep pre-optimization regardless of whether deps have changed.
|
|
619
606
|
* @experimental
|
|
620
607
|
*/
|
|
621
608
|
force?: boolean;
|
|
622
|
-
}
|
|
609
|
+
};
|
|
623
610
|
|
|
624
611
|
export declare interface DepOptimizationProcessing {
|
|
625
612
|
promise: Promise<void>;
|
|
@@ -638,11 +625,9 @@ export declare interface DepOptimizationResult {
|
|
|
638
625
|
}
|
|
639
626
|
|
|
640
627
|
export declare interface DepsOptimizer {
|
|
641
|
-
metadata:
|
|
642
|
-
ssr: boolean;
|
|
643
|
-
}) => DepOptimizationMetadata;
|
|
628
|
+
metadata: DepOptimizationMetadata;
|
|
644
629
|
scanProcessing?: Promise<void>;
|
|
645
|
-
registerMissingImport: (id: string, resolved: string
|
|
630
|
+
registerMissingImport: (id: string, resolved: string) => OptimizedDepInfo;
|
|
646
631
|
run: () => void;
|
|
647
632
|
isOptimizedDepFile: (id: string) => boolean;
|
|
648
633
|
isOptimizedDepUrl: (url: string) => boolean;
|
|
@@ -699,11 +684,11 @@ export declare interface ExperimentalOptions {
|
|
|
699
684
|
*/
|
|
700
685
|
importGlobRestoreExtension?: boolean;
|
|
701
686
|
/**
|
|
702
|
-
*
|
|
687
|
+
* Allow finegrain contol over assets and public files paths
|
|
703
688
|
*
|
|
704
689
|
* @experimental
|
|
705
690
|
*/
|
|
706
|
-
|
|
691
|
+
renderBuiltUrl?: RenderBuiltAssetUrl;
|
|
707
692
|
/**
|
|
708
693
|
* Enables support of HMR partial accept via `import.meta.hot.acceptExports`.
|
|
709
694
|
*
|
|
@@ -832,6 +817,8 @@ export declare interface FullReloadPayload {
|
|
|
832
817
|
path?: string
|
|
833
818
|
}
|
|
834
819
|
|
|
820
|
+
export declare function getDepOptimizationConfig(config: ResolvedConfig, ssr: boolean): DepOptimizationConfig;
|
|
821
|
+
|
|
835
822
|
export declare interface HmrContext {
|
|
836
823
|
file: string;
|
|
837
824
|
timestamp: number;
|
|
@@ -1227,11 +1214,12 @@ export declare interface InternalResolveOptions extends ResolveOptions {
|
|
|
1227
1214
|
isFromTsImporter?: boolean;
|
|
1228
1215
|
tryEsmOnly?: boolean;
|
|
1229
1216
|
scan?: boolean;
|
|
1230
|
-
|
|
1217
|
+
ssrOptimizeCheck?: boolean;
|
|
1218
|
+
getDepsOptimizer?: (ssr: boolean) => DepsOptimizer | undefined;
|
|
1231
1219
|
shouldExternalize?: (id: string) => boolean | undefined;
|
|
1232
1220
|
}
|
|
1233
1221
|
|
|
1234
|
-
export declare function isDepsOptimizerEnabled(config: ResolvedConfig): boolean;
|
|
1222
|
+
export declare function isDepsOptimizerEnabled(config: ResolvedConfig, ssr: boolean): boolean;
|
|
1235
1223
|
|
|
1236
1224
|
export declare interface JsonOptions {
|
|
1237
1225
|
/**
|
|
@@ -1254,14 +1242,6 @@ export declare interface KnownAsTypeMap {
|
|
|
1254
1242
|
}
|
|
1255
1243
|
|
|
1256
1244
|
export declare interface LegacyOptions {
|
|
1257
|
-
/**
|
|
1258
|
-
* Revert vite dev to the v2.9 strategy. Enable esbuild based deps scanner.
|
|
1259
|
-
*
|
|
1260
|
-
* @experimental
|
|
1261
|
-
* @deprecated
|
|
1262
|
-
* @default false
|
|
1263
|
-
*/
|
|
1264
|
-
devDepsScanner?: boolean;
|
|
1265
1245
|
/**
|
|
1266
1246
|
* Revert vite build to the v2.9 strategy. Disable esbuild deps optimization and adds `@rollup/plugin-commonjs`
|
|
1267
1247
|
*
|
|
@@ -1380,7 +1360,7 @@ export declare class ModuleGraph {
|
|
|
1380
1360
|
* returned as a Set.
|
|
1381
1361
|
*/
|
|
1382
1362
|
updateModuleInfo(mod: ModuleNode, importedModules: Set<string | ModuleNode>, importedBindings: Map<string, Set<string>> | null, acceptedModules: Set<string | ModuleNode>, acceptedExports: Set<string> | null, isSelfAccepting: boolean, ssr?: boolean): Promise<Set<ModuleNode> | undefined>;
|
|
1383
|
-
ensureEntryFromUrl(rawUrl: string, ssr?: boolean): Promise<ModuleNode>;
|
|
1363
|
+
ensureEntryFromUrl(rawUrl: string, ssr?: boolean, setIsSelfAccepting?: boolean): Promise<ModuleNode>;
|
|
1384
1364
|
createFileOnlyEntry(file: string): ModuleNode;
|
|
1385
1365
|
resolveUrl(url: string, ssr?: boolean): Promise<ResolvedUrl>;
|
|
1386
1366
|
}
|
|
@@ -1410,7 +1390,10 @@ export declare class ModuleNode {
|
|
|
1410
1390
|
ssrError: Error | null;
|
|
1411
1391
|
lastHMRTimestamp: number;
|
|
1412
1392
|
lastInvalidationTimestamp: number;
|
|
1413
|
-
|
|
1393
|
+
/**
|
|
1394
|
+
* @param setIsSelfAccepting - set `false` to set `isSelfAccepting` later. e.g. #7870
|
|
1395
|
+
*/
|
|
1396
|
+
constructor(url: string, setIsSelfAccepting?: boolean);
|
|
1414
1397
|
}
|
|
1415
1398
|
|
|
1416
1399
|
export declare function normalizePath(id: string): string;
|
|
@@ -1653,19 +1636,24 @@ export declare interface PrunePayload {
|
|
|
1653
1636
|
paths: string[]
|
|
1654
1637
|
}
|
|
1655
1638
|
|
|
1639
|
+
export declare type RenderBuiltAssetUrl = (filename: string, type: {
|
|
1640
|
+
type: 'asset' | 'public';
|
|
1641
|
+
hostId: string;
|
|
1642
|
+
hostType: 'js' | 'css' | 'html';
|
|
1643
|
+
ssr: boolean;
|
|
1644
|
+
}) => string | {
|
|
1645
|
+
relative?: boolean;
|
|
1646
|
+
runtime?: string;
|
|
1647
|
+
} | undefined;
|
|
1648
|
+
|
|
1656
1649
|
/**
|
|
1657
1650
|
* Resolve base url. Note that some users use Vite to build for non-web targets like
|
|
1658
1651
|
* electron or expects to deploy
|
|
1659
1652
|
*/
|
|
1660
|
-
export declare function resolveBaseUrl(base: string | undefined, isBuild: boolean, logger: Logger
|
|
1653
|
+
export declare function resolveBaseUrl(base: string | undefined, isBuild: boolean, logger: Logger): string;
|
|
1661
1654
|
|
|
1662
1655
|
export declare function resolveConfig(inlineConfig: InlineConfig, command: 'build' | 'serve', defaultMode?: string): Promise<ResolvedConfig>;
|
|
1663
1656
|
|
|
1664
|
-
export declare type ResolvedBuildAdvancedBaseConfig = BuildAdvancedBaseOptions & {
|
|
1665
|
-
assets: BuildAdvancedBaseOptions;
|
|
1666
|
-
public: BuildAdvancedBaseOptions;
|
|
1667
|
-
};
|
|
1668
|
-
|
|
1669
1657
|
export declare type ResolvedBuildOptions = Required<BuildOptions>;
|
|
1670
1658
|
|
|
1671
1659
|
export declare type ResolvedConfig = Readonly<Omit<UserConfig, 'plugins' | 'assetsInclude' | 'optimizeDeps' | 'worker'> & {
|
|
@@ -1689,7 +1677,7 @@ export declare type ResolvedConfig = Readonly<Omit<UserConfig, 'plugins' | 'asse
|
|
|
1689
1677
|
server: ResolvedServerOptions;
|
|
1690
1678
|
build: ResolvedBuildOptions;
|
|
1691
1679
|
preview: ResolvedPreviewOptions;
|
|
1692
|
-
ssr: ResolvedSSROptions
|
|
1680
|
+
ssr: ResolvedSSROptions;
|
|
1693
1681
|
assetsInclude: (file: string) => boolean;
|
|
1694
1682
|
logger: Logger;
|
|
1695
1683
|
createResolver: (options?: Partial<InternalResolveOptions>) => ResolveFn;
|
|
@@ -1697,13 +1685,9 @@ export declare type ResolvedConfig = Readonly<Omit<UserConfig, 'plugins' | 'asse
|
|
|
1697
1685
|
/* Excluded from this release type: packageCache */
|
|
1698
1686
|
worker: ResolveWorkerOptions;
|
|
1699
1687
|
appType: AppType;
|
|
1700
|
-
experimental:
|
|
1688
|
+
experimental: ExperimentalOptions;
|
|
1701
1689
|
}>;
|
|
1702
1690
|
|
|
1703
|
-
export declare type ResolvedExperimentalOptions = Required<ExperimentalOptions> & {
|
|
1704
|
-
buildAdvancedBaseOptions: ResolvedBuildAdvancedBaseConfig;
|
|
1705
|
-
};
|
|
1706
|
-
|
|
1707
1691
|
export declare interface ResolvedPreviewOptions extends PreviewOptions {
|
|
1708
1692
|
}
|
|
1709
1693
|
|
|
@@ -1715,6 +1699,7 @@ export declare interface ResolvedServerOptions extends ServerOptions {
|
|
|
1715
1699
|
export declare interface ResolvedSSROptions extends SSROptions {
|
|
1716
1700
|
target: SSRTarget;
|
|
1717
1701
|
format: SSRFormat;
|
|
1702
|
+
optimizeDeps: SsrDepOptimizationOptions;
|
|
1718
1703
|
}
|
|
1719
1704
|
|
|
1720
1705
|
export declare type ResolvedUrl = [
|
|
@@ -2005,6 +1990,13 @@ export declare interface ServerOptions extends CommonServerOptions {
|
|
|
2005
1990
|
* @default true
|
|
2006
1991
|
*/
|
|
2007
1992
|
preTransformRequests?: boolean;
|
|
1993
|
+
/**
|
|
1994
|
+
* Force dep pre-optimization regardless of whether deps have changed.
|
|
1995
|
+
*
|
|
1996
|
+
* @deprecated Use optimizeDeps.force instead, this option may be removed
|
|
1997
|
+
* in a future minor version without following semver
|
|
1998
|
+
*/
|
|
1999
|
+
force?: boolean;
|
|
2008
2000
|
}
|
|
2009
2001
|
|
|
2010
2002
|
export declare function sortUserPlugins(plugins: (Plugin_2 | Plugin_2[])[] | undefined): [Plugin_2[], Plugin_2[], Plugin_2[]];
|
|
@@ -2021,11 +2013,13 @@ export declare class SplitVendorChunkCache {
|
|
|
2021
2013
|
|
|
2022
2014
|
export declare function splitVendorChunkPlugin(): Plugin_2;
|
|
2023
2015
|
|
|
2016
|
+
export declare type SsrDepOptimizationOptions = DepOptimizationConfig;
|
|
2017
|
+
|
|
2024
2018
|
export declare type SSRFormat = 'esm' | 'cjs';
|
|
2025
2019
|
|
|
2026
2020
|
export declare interface SSROptions {
|
|
2027
|
-
external?: string[];
|
|
2028
2021
|
noExternal?: string | RegExp | (string | RegExp)[] | true;
|
|
2022
|
+
external?: string[];
|
|
2029
2023
|
/**
|
|
2030
2024
|
* Define the target for the ssr build. The browser field in package.json
|
|
2031
2025
|
* is ignored for node but used if webworker is the target
|
|
@@ -2040,6 +2034,15 @@ export declare interface SSROptions {
|
|
|
2040
2034
|
* @experimental
|
|
2041
2035
|
*/
|
|
2042
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;
|
|
2043
2046
|
}
|
|
2044
2047
|
|
|
2045
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';
|
|
@@ -26,7 +26,6 @@ import 'node:dns';
|
|
|
26
26
|
import 'resolve';
|
|
27
27
|
import 'crypto';
|
|
28
28
|
import 'buffer';
|
|
29
|
-
import 'querystring';
|
|
30
29
|
import 'module';
|
|
31
30
|
import 'zlib';
|
|
32
31
|
import 'https';
|
|
@@ -34,6 +33,7 @@ import 'tls';
|
|
|
34
33
|
import 'node:http';
|
|
35
34
|
import 'node:https';
|
|
36
35
|
import 'worker_threads';
|
|
36
|
+
import 'querystring';
|
|
37
37
|
import 'readline';
|
|
38
38
|
import 'node:child_process';
|
|
39
39
|
import 'node:zlib';
|
|
@@ -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(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Evan You",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"./client": {
|
|
21
21
|
"types": "./client.d.ts"
|
|
22
22
|
},
|
|
23
|
-
"./dist/client/*": "./dist/client/*"
|
|
23
|
+
"./dist/client/*": "./dist/client/*",
|
|
24
|
+
"./package.json": "./package.json"
|
|
24
25
|
},
|
|
25
26
|
"files": [
|
|
26
27
|
"bin",
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
},
|
|
58
59
|
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
|
|
59
60
|
"dependencies": {
|
|
60
|
-
"esbuild": "^0.14.
|
|
61
|
+
"esbuild": "^0.14.47",
|
|
61
62
|
"postcss": "^8.4.14",
|
|
62
63
|
"resolve": "^1.22.1",
|
|
63
64
|
"rollup": "^2.75.6"
|
|
@@ -67,9 +68,9 @@
|
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
69
70
|
"@ampproject/remapping": "^2.2.0",
|
|
70
|
-
"@babel/parser": "^7.18.
|
|
71
|
-
"@babel/types": "^7.18.
|
|
72
|
-
"@jridgewell/trace-mapping": "^0.3.
|
|
71
|
+
"@babel/parser": "^7.18.6",
|
|
72
|
+
"@babel/types": "^7.18.7",
|
|
73
|
+
"@jridgewell/trace-mapping": "^0.3.14",
|
|
73
74
|
"@rollup/plugin-alias": "^3.1.9",
|
|
74
75
|
"@rollup/plugin-commonjs": "^22.0.1",
|
|
75
76
|
"@rollup/plugin-dynamic-import-vars": "^1.4.3",
|
|
@@ -82,7 +83,7 @@
|
|
|
82
83
|
"cac": "^6.7.12",
|
|
83
84
|
"chokidar": "^3.5.3",
|
|
84
85
|
"connect": "^3.7.0",
|
|
85
|
-
"connect-history-api-fallback": "^
|
|
86
|
+
"connect-history-api-fallback": "^2.0.0",
|
|
86
87
|
"convert-source-map": "^1.8.0",
|
|
87
88
|
"cors": "^2.8.5",
|
|
88
89
|
"cross-spawn": "^7.0.3",
|
|
@@ -98,7 +99,7 @@
|
|
|
98
99
|
"launch-editor-middleware": "^2.4.0",
|
|
99
100
|
"magic-string": "^0.26.2",
|
|
100
101
|
"micromatch": "^4.0.5",
|
|
101
|
-
"mlly": "^0.5.
|
|
102
|
+
"mlly": "^0.5.4",
|
|
102
103
|
"mrmime": "^1.0.1",
|
|
103
104
|
"node-forge": "^1.3.1",
|
|
104
105
|
"okie": "^1.0.1",
|