vite 4.0.0-alpha.6 → 4.0.0-beta.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/bin/vite.js +1 -1
- package/client.d.ts +1 -1
- package/dist/client/client.mjs +7 -6
- package/dist/client/client.mjs.map +1 -1
- package/dist/node/chunks/{dep-4ec4968a.js → dep-1e0f5bc1.js} +58 -18
- package/dist/node/chunks/{dep-cabd8261.js → dep-2ee6aff6.js} +1 -1
- package/dist/node/chunks/{dep-68d444d0.js → dep-86149127.js} +1782 -623
- package/dist/node/cli.js +12 -12
- package/dist/node/constants.js +7 -7
- package/dist/node/index.d.ts +106 -94
- package/dist/node/index.js +6 -6
- package/dist/node-cjs/publicUtils.cjs +33 -32
- package/index.cjs +2 -2
- package/package.json +5 -5
- package/types/customEvent.d.ts +1 -1
- package/types/hot.d.ts +3 -4
- package/types/importGlob.d.ts +8 -8
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 { z as picocolors, v as createLogger, g as resolveConfig } from './chunks/dep-
|
|
5
|
+
import { z as picocolors, v as createLogger, g as resolveConfig } from './chunks/dep-86149127.js';
|
|
6
6
|
import { VERSION } from './constants.js';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import 'node:module';
|
|
@@ -720,7 +720,7 @@ cli
|
|
|
720
720
|
filterDuplicateOptions(options);
|
|
721
721
|
// output structure is preserved even after bundling so require()
|
|
722
722
|
// is ok here
|
|
723
|
-
const { createServer } = await import('./chunks/dep-
|
|
723
|
+
const { createServer } = await import('./chunks/dep-86149127.js').then(function (n) { return n.D; });
|
|
724
724
|
try {
|
|
725
725
|
const server = await createServer({
|
|
726
726
|
root,
|
|
@@ -730,7 +730,7 @@ cli
|
|
|
730
730
|
logLevel: options.logLevel,
|
|
731
731
|
clearScreen: options.clearScreen,
|
|
732
732
|
optimizeDeps: { force: options.force },
|
|
733
|
-
server: cleanOptions(options)
|
|
733
|
+
server: cleanOptions(options),
|
|
734
734
|
});
|
|
735
735
|
if (!server.httpServer) {
|
|
736
736
|
throw new Error('HTTP server not available');
|
|
@@ -749,7 +749,7 @@ cli
|
|
|
749
749
|
catch (e) {
|
|
750
750
|
const logger = createLogger(options.logLevel);
|
|
751
751
|
logger.error(picocolors.exports.red(`error when starting dev server:\n${e.stack}`), {
|
|
752
|
-
error: e
|
|
752
|
+
error: e,
|
|
753
753
|
});
|
|
754
754
|
stopProfiler(logger.info);
|
|
755
755
|
process.exit(1);
|
|
@@ -773,7 +773,7 @@ cli
|
|
|
773
773
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
|
774
774
|
.action(async (root, options) => {
|
|
775
775
|
filterDuplicateOptions(options);
|
|
776
|
-
const { build } = await import('./chunks/dep-
|
|
776
|
+
const { build } = await import('./chunks/dep-86149127.js').then(function (n) { return n.C; });
|
|
777
777
|
const buildOptions = cleanOptions(options);
|
|
778
778
|
try {
|
|
779
779
|
await build({
|
|
@@ -784,7 +784,7 @@ cli
|
|
|
784
784
|
logLevel: options.logLevel,
|
|
785
785
|
clearScreen: options.clearScreen,
|
|
786
786
|
optimizeDeps: { force: options.force },
|
|
787
|
-
build: buildOptions
|
|
787
|
+
build: buildOptions,
|
|
788
788
|
});
|
|
789
789
|
}
|
|
790
790
|
catch (e) {
|
|
@@ -801,13 +801,13 @@ cli
|
|
|
801
801
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
|
802
802
|
.action(async (root, options) => {
|
|
803
803
|
filterDuplicateOptions(options);
|
|
804
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
|
804
|
+
const { optimizeDeps } = await import('./chunks/dep-86149127.js').then(function (n) { return n.B; });
|
|
805
805
|
try {
|
|
806
806
|
const config = await resolveConfig({
|
|
807
807
|
root,
|
|
808
808
|
base: options.base,
|
|
809
809
|
configFile: options.config,
|
|
810
|
-
logLevel: options.logLevel
|
|
810
|
+
logLevel: options.logLevel,
|
|
811
811
|
}, 'build');
|
|
812
812
|
await optimizeDeps(config, options.force, true);
|
|
813
813
|
}
|
|
@@ -826,7 +826,7 @@ cli
|
|
|
826
826
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
|
827
827
|
.action(async (root, options) => {
|
|
828
828
|
filterDuplicateOptions(options);
|
|
829
|
-
const { preview } = await import('./chunks/dep-
|
|
829
|
+
const { preview } = await import('./chunks/dep-86149127.js').then(function (n) { return n.E; });
|
|
830
830
|
try {
|
|
831
831
|
const server = await preview({
|
|
832
832
|
root,
|
|
@@ -835,15 +835,15 @@ cli
|
|
|
835
835
|
logLevel: options.logLevel,
|
|
836
836
|
mode: options.mode,
|
|
837
837
|
build: {
|
|
838
|
-
outDir: options.outDir
|
|
838
|
+
outDir: options.outDir,
|
|
839
839
|
},
|
|
840
840
|
preview: {
|
|
841
841
|
port: options.port,
|
|
842
842
|
strictPort: options.strictPort,
|
|
843
843
|
host: options.host,
|
|
844
844
|
https: options.https,
|
|
845
|
-
open: options.open
|
|
846
|
-
}
|
|
845
|
+
open: options.open,
|
|
846
|
+
},
|
|
847
847
|
});
|
|
848
848
|
server.printUrls();
|
|
849
849
|
}
|
package/dist/node/constants.js
CHANGED
|
@@ -7,7 +7,7 @@ const VERSION = version;
|
|
|
7
7
|
const DEFAULT_MAIN_FIELDS = [
|
|
8
8
|
'module',
|
|
9
9
|
'jsnext:main',
|
|
10
|
-
'jsnext'
|
|
10
|
+
'jsnext',
|
|
11
11
|
];
|
|
12
12
|
// Baseline support browserslist
|
|
13
13
|
// "defaults and supports es6-module and supports es6-module-dynamic-import"
|
|
@@ -17,7 +17,7 @@ const ESBUILD_MODULES_TARGET = [
|
|
|
17
17
|
'edge88',
|
|
18
18
|
'firefox78',
|
|
19
19
|
'chrome87',
|
|
20
|
-
'safari14'
|
|
20
|
+
'safari14',
|
|
21
21
|
];
|
|
22
22
|
const DEFAULT_EXTENSIONS = [
|
|
23
23
|
'.mjs',
|
|
@@ -26,7 +26,7 @@ const DEFAULT_EXTENSIONS = [
|
|
|
26
26
|
'.ts',
|
|
27
27
|
'.jsx',
|
|
28
28
|
'.tsx',
|
|
29
|
-
'.json'
|
|
29
|
+
'.json',
|
|
30
30
|
];
|
|
31
31
|
const DEFAULT_CONFIG_FILES = [
|
|
32
32
|
'vite.config.js',
|
|
@@ -34,7 +34,7 @@ const DEFAULT_CONFIG_FILES = [
|
|
|
34
34
|
'vite.config.ts',
|
|
35
35
|
'vite.config.cjs',
|
|
36
36
|
'vite.config.mts',
|
|
37
|
-
'vite.config.cts'
|
|
37
|
+
'vite.config.cts',
|
|
38
38
|
];
|
|
39
39
|
const JS_TYPES_RE = /\.(?:j|t)sx?$|\.mjs$/;
|
|
40
40
|
const CSS_LANGS_RE = /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)($|\\?)/;
|
|
@@ -102,7 +102,7 @@ const KNOWN_ASSET_TYPES = [
|
|
|
102
102
|
// other
|
|
103
103
|
'webmanifest',
|
|
104
104
|
'pdf',
|
|
105
|
-
'txt'
|
|
105
|
+
'txt',
|
|
106
106
|
];
|
|
107
107
|
const DEFAULT_ASSETS_RE = new RegExp(`\\.(` + KNOWN_ASSET_TYPES.join('|') + `)(\\?.*)?$`);
|
|
108
108
|
const DEP_VERSION_RE = /[?&](v=[\w.-]+)\b/;
|
|
@@ -110,12 +110,12 @@ const loopbackHosts = new Set([
|
|
|
110
110
|
'localhost',
|
|
111
111
|
'127.0.0.1',
|
|
112
112
|
'::1',
|
|
113
|
-
'0000:0000:0000:0000:0000:0000:0000:0001'
|
|
113
|
+
'0000:0000:0000:0000:0000:0000:0000:0001',
|
|
114
114
|
]);
|
|
115
115
|
const wildcardHosts = new Set([
|
|
116
116
|
'0.0.0.0',
|
|
117
117
|
'::',
|
|
118
|
-
'0000:0000:0000:0000:0000:0000:0000:0000'
|
|
118
|
+
'0000:0000:0000:0000:0000:0000:0000:0000',
|
|
119
119
|
]);
|
|
120
120
|
|
|
121
121
|
export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, CSS_LANGS_RE, 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 };
|