vite 5.0.0-beta.9 → 5.0.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/LICENSE.md +22 -36
- package/dist/client/client.mjs +17 -3
- package/dist/client/client.mjs.map +1 -1
- package/dist/node/chunks/{dep-6d23b7fa.js → dep-1HTAyDZa.js} +145 -145
- package/dist/node/chunks/{dep-e04185e5.js → dep-2UYu25Ks.js} +2 -2
- package/dist/node/chunks/{dep-ffdf177d.js → dep-VPh1kAXQ.js} +23586 -23469
- package/dist/node/cli.js +32 -35
- package/dist/node/constants.js +1 -0
- package/dist/node/index.d.ts +122 -67
- package/dist/node/index.js +4 -3
- package/dist/node-cjs/publicUtils.cjs +389 -373
- package/index.cjs +0 -1
- package/package.json +12 -13
- /package/dist/node/chunks/{dep-c423598f.js → dep-8a-6Quh6.js} +0 -0
- /package/dist/node/chunks/{dep-f0c7dae0.js → dep-kjUoH5nk.js} +0 -0
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 { x as colors, k as createLogger, r as resolveConfig } from './chunks/dep-
|
|
5
|
+
import { x as colors, k as createLogger, r as resolveConfig } from './chunks/dep-VPh1kAXQ.js';
|
|
6
6
|
import { VERSION } from './constants.js';
|
|
7
7
|
import 'node:fs/promises';
|
|
8
8
|
import 'node:url';
|
|
@@ -14,6 +14,7 @@ import 'path';
|
|
|
14
14
|
import 'fs';
|
|
15
15
|
import 'assert';
|
|
16
16
|
import 'node:http';
|
|
17
|
+
import 'node:https';
|
|
17
18
|
import 'util';
|
|
18
19
|
import 'net';
|
|
19
20
|
import 'url';
|
|
@@ -32,10 +33,10 @@ import 'node:assert';
|
|
|
32
33
|
import 'node:process';
|
|
33
34
|
import 'node:v8';
|
|
34
35
|
import 'rollup';
|
|
36
|
+
import 'rollup/parseAst';
|
|
35
37
|
import 'querystring';
|
|
36
38
|
import 'node:readline';
|
|
37
39
|
import 'node:events';
|
|
38
|
-
import 'node:https';
|
|
39
40
|
import 'zlib';
|
|
40
41
|
import 'buffer';
|
|
41
42
|
import 'https';
|
|
@@ -750,7 +751,6 @@ cli
|
|
|
750
751
|
.alias('dev') // alias to align with the script name
|
|
751
752
|
.option('--host [host]', `[string] specify hostname`, { type: [convertHost] })
|
|
752
753
|
.option('--port <port>', `[number] specify port`)
|
|
753
|
-
.option('--https', `[boolean] use TLS + HTTP/2`)
|
|
754
754
|
.option('--open [path]', `[boolean | string] open browser on startup`)
|
|
755
755
|
.option('--cors', `[boolean] enable CORS`)
|
|
756
756
|
.option('--strictPort', `[boolean] exit if specified port is already in use`)
|
|
@@ -759,7 +759,7 @@ cli
|
|
|
759
759
|
filterDuplicateOptions(options);
|
|
760
760
|
// output structure is preserved even after bundling so require()
|
|
761
761
|
// is ok here
|
|
762
|
-
const { createServer } = await import('./chunks/dep-
|
|
762
|
+
const { createServer } = await import('./chunks/dep-VPh1kAXQ.js').then(function (n) { return n.A; });
|
|
763
763
|
try {
|
|
764
764
|
const server = await createServer({
|
|
765
765
|
root,
|
|
@@ -780,38 +780,37 @@ cli
|
|
|
780
780
|
const startupDurationString = viteStartTime
|
|
781
781
|
? colors.dim(`ready in ${colors.reset(colors.bold(Math.ceil(performance.now() - viteStartTime)))} ms`)
|
|
782
782
|
: '';
|
|
783
|
+
const hasExistingLogs = process.stdout.bytesWritten > 0 || process.stderr.bytesWritten > 0;
|
|
783
784
|
info(`\n ${colors.green(`${colors.bold('VITE')} v${VERSION}`)} ${startupDurationString}\n`, {
|
|
784
|
-
clear: !
|
|
785
|
-
!globalThis.__vite_cjs_skip_clear_screen,
|
|
785
|
+
clear: !hasExistingLogs,
|
|
786
786
|
});
|
|
787
787
|
server.printUrls();
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
customShortcuts
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
profileSession.post('Profiler.
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
res();
|
|
807
|
-
});
|
|
788
|
+
const customShortcuts = [];
|
|
789
|
+
if (profileSession) {
|
|
790
|
+
customShortcuts.push({
|
|
791
|
+
key: 'p',
|
|
792
|
+
description: 'start/stop the profiler',
|
|
793
|
+
async action(server) {
|
|
794
|
+
if (profileSession) {
|
|
795
|
+
await stopProfiler(server.config.logger.info);
|
|
796
|
+
}
|
|
797
|
+
else {
|
|
798
|
+
const inspector = await import('node:inspector').then((r) => r.default);
|
|
799
|
+
await new Promise((res) => {
|
|
800
|
+
profileSession = new inspector.Session();
|
|
801
|
+
profileSession.connect();
|
|
802
|
+
profileSession.post('Profiler.enable', () => {
|
|
803
|
+
profileSession.post('Profiler.start', () => {
|
|
804
|
+
server.config.logger.info('Profiler started');
|
|
805
|
+
res();
|
|
808
806
|
});
|
|
809
807
|
});
|
|
810
|
-
}
|
|
811
|
-
}
|
|
808
|
+
});
|
|
809
|
+
}
|
|
812
810
|
},
|
|
813
|
-
|
|
814
|
-
}
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
server.bindCLIShortcuts({ print: true, customShortcuts });
|
|
815
814
|
}
|
|
816
815
|
catch (e) {
|
|
817
816
|
const logger = createLogger(options.logLevel);
|
|
@@ -840,7 +839,7 @@ cli
|
|
|
840
839
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
|
841
840
|
.action(async (root, options) => {
|
|
842
841
|
filterDuplicateOptions(options);
|
|
843
|
-
const { build } = await import('./chunks/dep-
|
|
842
|
+
const { build } = await import('./chunks/dep-VPh1kAXQ.js').then(function (n) { return n.C; });
|
|
844
843
|
const buildOptions = cleanOptions(options);
|
|
845
844
|
try {
|
|
846
845
|
await build({
|
|
@@ -868,7 +867,7 @@ cli
|
|
|
868
867
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
|
869
868
|
.action(async (root, options) => {
|
|
870
869
|
filterDuplicateOptions(options);
|
|
871
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
|
870
|
+
const { optimizeDeps } = await import('./chunks/dep-VPh1kAXQ.js').then(function (n) { return n.B; });
|
|
872
871
|
try {
|
|
873
872
|
const config = await resolveConfig({
|
|
874
873
|
root,
|
|
@@ -890,12 +889,11 @@ cli
|
|
|
890
889
|
.option('--host [host]', `[string] specify hostname`, { type: [convertHost] })
|
|
891
890
|
.option('--port <port>', `[number] specify port`)
|
|
892
891
|
.option('--strictPort', `[boolean] exit if specified port is already in use`)
|
|
893
|
-
.option('--https', `[boolean] use TLS + HTTP/2`)
|
|
894
892
|
.option('--open [path]', `[boolean | string] open browser on startup`)
|
|
895
893
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
|
896
894
|
.action(async (root, options) => {
|
|
897
895
|
filterDuplicateOptions(options);
|
|
898
|
-
const { preview } = await import('./chunks/dep-
|
|
896
|
+
const { preview } = await import('./chunks/dep-VPh1kAXQ.js').then(function (n) { return n.D; });
|
|
899
897
|
try {
|
|
900
898
|
const server = await preview({
|
|
901
899
|
root,
|
|
@@ -910,7 +908,6 @@ cli
|
|
|
910
908
|
port: options.port,
|
|
911
909
|
strictPort: options.strictPort,
|
|
912
910
|
host: options.host,
|
|
913
|
-
https: options.https,
|
|
914
911
|
open: options.open,
|
|
915
912
|
},
|
|
916
913
|
});
|
package/dist/node/constants.js
CHANGED