vite 3.0.0-beta.1 → 3.0.0-beta.4
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/client/client.mjs.map +1 -1
- package/dist/node/chunks/{dep-d0efd013.js → dep-02aa3d4a.js} +3119 -3119
- package/dist/node/chunks/{dep-e8ca8d40.js → dep-07a79996.js} +121 -113
- package/dist/node/chunks/{dep-077259ad.js → dep-07df4e90.js} +32403 -31880
- package/dist/node/chunks/dep-30bcfc51.js +7545 -0
- package/dist/node/chunks/{dep-58d622b1.js → dep-3856e872.js} +3 -3
- package/dist/node/chunks/{dep-35befe4f.js → dep-d55123c0.js} +6 -6
- package/dist/node/cli.js +12 -12
- package/dist/node/constants.js +13 -3
- package/dist/node/index.d.ts +13 -6
- package/dist/node/index.js +2 -2
- package/dist/node-cjs/publicUtils.cjs +1004 -963
- package/package.json +3 -4
- package/src/client/client.ts +1 -1
- package/dist/node/chunks/dep-cd58a191.js +0 -7505
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path$3 from 'path';
|
|
2
|
-
import
|
|
2
|
+
import resolve$2 from 'resolve';
|
|
3
3
|
import require$$0__default from 'fs';
|
|
4
|
-
import { l as lib } from './dep-
|
|
4
|
+
import { l as lib } from './dep-07a79996.js';
|
|
5
5
|
|
|
6
6
|
import { fileURLToPath as __cjs_fileURLToPath } from 'node:url';
|
|
7
7
|
import { dirname as __cjs_dirname } from 'node:path';
|
|
@@ -48,7 +48,7 @@ var joinLayer$1 = function (parentLayer, childLayer) {
|
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
// external tooling
|
|
51
|
-
const resolve$1 =
|
|
51
|
+
const resolve$1 = resolve$2;
|
|
52
52
|
|
|
53
53
|
const moduleDirectories = ["web_modules", "node_modules"];
|
|
54
54
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { y as commonjsGlobal } from './dep-
|
|
2
|
-
import require$$
|
|
1
|
+
import { y as commonjsGlobal } from './dep-07df4e90.js';
|
|
2
|
+
import require$$5 from 'crypto';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:path';
|
|
5
5
|
import 'node:url';
|
|
@@ -11,7 +11,6 @@ import 'path';
|
|
|
11
11
|
import 'fs';
|
|
12
12
|
import 'events';
|
|
13
13
|
import 'assert';
|
|
14
|
-
import 'resolve';
|
|
15
14
|
import 'util';
|
|
16
15
|
import 'net';
|
|
17
16
|
import 'url';
|
|
@@ -23,6 +22,7 @@ import 'node:os';
|
|
|
23
22
|
import 'node:crypto';
|
|
24
23
|
import 'node:util';
|
|
25
24
|
import 'node:dns';
|
|
25
|
+
import 'resolve';
|
|
26
26
|
import '../constants.js';
|
|
27
27
|
import 'buffer';
|
|
28
28
|
import 'querystring';
|
|
@@ -7521,7 +7521,7 @@ var pkcs5 = forge$i.pkcs5 = forge$i.pkcs5 || {};
|
|
|
7521
7521
|
|
|
7522
7522
|
var crypto;
|
|
7523
7523
|
if(forge$i.util.isNodejs && !forge$i.options.usePureJavaScript) {
|
|
7524
|
-
crypto = require$$
|
|
7524
|
+
crypto = require$$5;
|
|
7525
7525
|
}
|
|
7526
7526
|
|
|
7527
7527
|
/**
|
|
@@ -8301,7 +8301,7 @@ var forge$f = forge$s;
|
|
|
8301
8301
|
var _crypto$1 = null;
|
|
8302
8302
|
if(forge$f.util.isNodejs && !forge$f.options.usePureJavaScript &&
|
|
8303
8303
|
!process.versions['node-webkit']) {
|
|
8304
|
-
_crypto$1 = require$$
|
|
8304
|
+
_crypto$1 = require$$5;
|
|
8305
8305
|
}
|
|
8306
8306
|
|
|
8307
8307
|
/* PRNG API */
|
|
@@ -11523,7 +11523,7 @@ if(typeof BigInteger === 'undefined') {
|
|
|
11523
11523
|
var BigInteger = forge$8.jsbn.BigInteger;
|
|
11524
11524
|
}
|
|
11525
11525
|
|
|
11526
|
-
var _crypto = forge$8.util.isNodejs ? require$$
|
|
11526
|
+
var _crypto = forge$8.util.isNodejs ? require$$5 : null;
|
|
11527
11527
|
|
|
11528
11528
|
// shortcut for asn.1 API
|
|
11529
11529
|
var asn1$5 = forge$8.asn1;
|
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 { x as
|
|
3
|
+
import { x as picocolors, q as createLogger, e as resolveConfig } from './chunks/dep-07df4e90.js';
|
|
4
4
|
import { VERSION } from './constants.js';
|
|
5
5
|
import 'node:fs';
|
|
6
6
|
import 'node:path';
|
|
@@ -11,7 +11,6 @@ import 'esbuild';
|
|
|
11
11
|
import 'path';
|
|
12
12
|
import 'fs';
|
|
13
13
|
import 'assert';
|
|
14
|
-
import 'resolve';
|
|
15
14
|
import 'util';
|
|
16
15
|
import 'net';
|
|
17
16
|
import 'url';
|
|
@@ -23,6 +22,7 @@ import 'node:os';
|
|
|
23
22
|
import 'node:crypto';
|
|
24
23
|
import 'node:util';
|
|
25
24
|
import 'node:dns';
|
|
25
|
+
import 'resolve';
|
|
26
26
|
import 'crypto';
|
|
27
27
|
import 'buffer';
|
|
28
28
|
import 'querystring';
|
|
@@ -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-07df4e90.js').then(function (n) { return n.D; });
|
|
698
698
|
try {
|
|
699
699
|
const server = await createServer({
|
|
700
700
|
root,
|
|
@@ -714,13 +714,13 @@ cli
|
|
|
714
714
|
// @ts-ignore
|
|
715
715
|
const viteStartTime = global.__vite_start_time ?? false;
|
|
716
716
|
const startupDurationString = viteStartTime
|
|
717
|
-
?
|
|
717
|
+
? picocolors.exports.dim(`ready in ${picocolors.exports.white(picocolors.exports.bold(Math.ceil(performance.now() - viteStartTime)))} ms`)
|
|
718
718
|
: '';
|
|
719
|
-
info(`\n ${
|
|
719
|
+
info(`\n ${picocolors.exports.green(`${picocolors.exports.bold('VITE')} v${VERSION}`)} ${startupDurationString}\n`, { clear: !server.config.logger.hasWarned });
|
|
720
720
|
server.printUrls();
|
|
721
721
|
}
|
|
722
722
|
catch (e) {
|
|
723
|
-
createLogger(options.logLevel).error(
|
|
723
|
+
createLogger(options.logLevel).error(picocolors.exports.red(`error when starting dev server:\n${e.stack}`), { error: e });
|
|
724
724
|
process.exit(1);
|
|
725
725
|
}
|
|
726
726
|
});
|
|
@@ -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-07df4e90.js').then(function (n) { return n.C; });
|
|
745
745
|
const buildOptions = cleanOptions(options);
|
|
746
746
|
try {
|
|
747
747
|
await build({
|
|
@@ -756,7 +756,7 @@ cli
|
|
|
756
756
|
});
|
|
757
757
|
}
|
|
758
758
|
catch (e) {
|
|
759
|
-
createLogger(options.logLevel).error(
|
|
759
|
+
createLogger(options.logLevel).error(picocolors.exports.red(`error during build:\n${e.stack}`), { error: e });
|
|
760
760
|
process.exit(1);
|
|
761
761
|
}
|
|
762
762
|
});
|
|
@@ -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-07df4e90.js').then(function (n) { return n.B; });
|
|
769
769
|
try {
|
|
770
770
|
const config = await resolveConfig({
|
|
771
771
|
root,
|
|
@@ -776,7 +776,7 @@ cli
|
|
|
776
776
|
await optimizeDeps(config, options.force, true);
|
|
777
777
|
}
|
|
778
778
|
catch (e) {
|
|
779
|
-
createLogger(options.logLevel).error(
|
|
779
|
+
createLogger(options.logLevel).error(picocolors.exports.red(`error when optimizing deps:\n${e.stack}`), { error: e });
|
|
780
780
|
process.exit(1);
|
|
781
781
|
}
|
|
782
782
|
});
|
|
@@ -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-07df4e90.js').then(function (n) { return n.E; });
|
|
792
792
|
try {
|
|
793
793
|
const server = await preview({
|
|
794
794
|
root,
|
|
@@ -807,7 +807,7 @@ cli
|
|
|
807
807
|
server.printUrls();
|
|
808
808
|
}
|
|
809
809
|
catch (e) {
|
|
810
|
-
createLogger(options.logLevel).error(
|
|
810
|
+
createLogger(options.logLevel).error(picocolors.exports.red(`error when starting preview server:\n${e.stack}`), { error: e });
|
|
811
811
|
process.exit(1);
|
|
812
812
|
}
|
|
813
813
|
});
|
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.4";
|
|
5
5
|
|
|
6
6
|
const VERSION = version;
|
|
7
7
|
const DEFAULT_MAIN_FIELDS = [
|
|
@@ -17,6 +17,14 @@ const DEFAULT_EXTENSIONS = [
|
|
|
17
17
|
'.tsx',
|
|
18
18
|
'.json'
|
|
19
19
|
];
|
|
20
|
+
const DEFAULT_CONFIG_FILES = [
|
|
21
|
+
'vite.config.js',
|
|
22
|
+
'vite.config.mjs',
|
|
23
|
+
'vite.config.ts',
|
|
24
|
+
'vite.config.cjs',
|
|
25
|
+
'vite.config.mts',
|
|
26
|
+
'vite.config.cts'
|
|
27
|
+
];
|
|
20
28
|
const JS_TYPES_RE = /\.(?:j|t)sx?$|\.mjs$/;
|
|
21
29
|
const OPTIMIZABLE_ENTRY_RE = /\.(?:m?js|ts)$/;
|
|
22
30
|
const SPECIAL_QUERY_RE = /[\?&](?:worker|sharedworker|raw|url)\b/;
|
|
@@ -42,7 +50,9 @@ const VALID_ID_PREFIX = `/@id/`;
|
|
|
42
50
|
const NULL_BYTE_PLACEHOLDER = `__x00__`;
|
|
43
51
|
const CLIENT_PUBLIC_PATH = `/@vite/client`;
|
|
44
52
|
const ENV_PUBLIC_PATH = `/@vite/env`;
|
|
45
|
-
const VITE_PACKAGE_DIR = resolve(
|
|
53
|
+
const VITE_PACKAGE_DIR = resolve(
|
|
54
|
+
// import.meta.url is `dist/node/constants.js` after bundle
|
|
55
|
+
fileURLToPath(import.meta.url), '../../..');
|
|
46
56
|
const CLIENT_ENTRY = resolve(VITE_PACKAGE_DIR, 'dist/client/client.mjs');
|
|
47
57
|
const ENV_ENTRY = resolve(VITE_PACKAGE_DIR, 'dist/client/env.mjs');
|
|
48
58
|
const CLIENT_DIR = path.dirname(CLIENT_ENTRY);
|
|
@@ -96,4 +106,4 @@ const wildcardHosts = new Set([
|
|
|
96
106
|
'0000:0000:0000:0000:0000:0000:0000:0000'
|
|
97
107
|
]);
|
|
98
108
|
|
|
99
|
-
export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, DEFAULT_ASSETS_RE, 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 };
|
|
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 };
|
package/dist/node/index.d.ts
CHANGED
|
@@ -650,6 +650,7 @@ export declare interface DepsOptimizer {
|
|
|
650
650
|
delayDepsOptimizerUntil: (id: string, done: () => Promise<any>) => void;
|
|
651
651
|
registerWorkersSource: (id: string) => void;
|
|
652
652
|
resetRegisteredIds: () => void;
|
|
653
|
+
ensureFirstRun: () => void;
|
|
653
654
|
options: DepOptimizationOptions;
|
|
654
655
|
}
|
|
655
656
|
|
|
@@ -675,6 +676,10 @@ export declare interface ESBuildOptions extends EsbuildTransformOptions {
|
|
|
675
676
|
include?: string | RegExp | string[] | RegExp[];
|
|
676
677
|
exclude?: string | RegExp | string[] | RegExp[];
|
|
677
678
|
jsxInject?: string;
|
|
679
|
+
/**
|
|
680
|
+
* This option is not respected. Use `build.minify` instead.
|
|
681
|
+
*/
|
|
682
|
+
minify?: never;
|
|
678
683
|
}
|
|
679
684
|
|
|
680
685
|
export { EsbuildTransformOptions }
|
|
@@ -1563,17 +1568,18 @@ declare interface Plugin_2 extends Plugin_3 {
|
|
|
1563
1568
|
/**
|
|
1564
1569
|
* extend hooks with ssr flag
|
|
1565
1570
|
*/
|
|
1566
|
-
resolveId
|
|
1571
|
+
resolveId?: (this: PluginContext, source: string, importer: string | undefined, options: {
|
|
1567
1572
|
custom?: CustomPluginOptions;
|
|
1568
1573
|
ssr?: boolean;
|
|
1569
1574
|
/* Excluded from this release type: scan */
|
|
1570
|
-
|
|
1571
|
-
|
|
1575
|
+
isEntry: boolean;
|
|
1576
|
+
}) => Promise<ResolveIdResult> | ResolveIdResult;
|
|
1577
|
+
load?: (this: PluginContext, id: string, options?: {
|
|
1572
1578
|
ssr?: boolean;
|
|
1573
|
-
})
|
|
1574
|
-
transform
|
|
1579
|
+
}) => Promise<LoadResult> | LoadResult;
|
|
1580
|
+
transform?: (this: TransformPluginContext, code: string, id: string, options?: {
|
|
1575
1581
|
ssr?: boolean;
|
|
1576
|
-
})
|
|
1582
|
+
}) => Promise<TransformResult_2> | TransformResult_2;
|
|
1577
1583
|
}
|
|
1578
1584
|
export { Plugin_2 as Plugin }
|
|
1579
1585
|
|
|
@@ -1585,6 +1591,7 @@ export declare interface PluginContainer {
|
|
|
1585
1591
|
skip?: Set<Plugin_2>;
|
|
1586
1592
|
ssr?: boolean;
|
|
1587
1593
|
/* Excluded from this release type: scan */
|
|
1594
|
+
isEntry?: boolean;
|
|
1588
1595
|
}): Promise<PartialResolvedId | null>;
|
|
1589
1596
|
transform(code: string, id: string, options?: {
|
|
1590
1597
|
inMap?: SourceDescription['map'];
|
package/dist/node/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as build, j as createFilter, q as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, i as isDepsOptimizerEnabled, l as loadConfigFromFile, v as loadEnv, h as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, p as preview, g as resolveBaseUrl, e as resolveConfig, w as resolveEnvPrefix, a as resolvePackageData, r as resolvePackageEntry, u as searchForWorkspaceRoot, k as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
|
1
|
+
export { b as build, j as createFilter, q as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, i as isDepsOptimizerEnabled, l as loadConfigFromFile, v as loadEnv, h as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, p as preview, g as resolveBaseUrl, e as resolveConfig, w as resolveEnvPrefix, a as resolvePackageData, r as resolvePackageEntry, u as searchForWorkspaceRoot, k as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-07df4e90.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';
|
|
@@ -12,7 +12,6 @@ import 'path';
|
|
|
12
12
|
import 'fs';
|
|
13
13
|
import 'events';
|
|
14
14
|
import 'assert';
|
|
15
|
-
import 'resolve';
|
|
16
15
|
import 'util';
|
|
17
16
|
import 'net';
|
|
18
17
|
import 'url';
|
|
@@ -24,6 +23,7 @@ import 'node:os';
|
|
|
24
23
|
import 'node:crypto';
|
|
25
24
|
import 'node:util';
|
|
26
25
|
import 'node:dns';
|
|
26
|
+
import 'resolve';
|
|
27
27
|
import 'crypto';
|
|
28
28
|
import 'buffer';
|
|
29
29
|
import 'querystring';
|