vite 6.0.0-alpha.14 → 6.0.0-alpha.16
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 +1 -1
- package/dist/client/client.mjs.map +1 -1
- package/dist/node/chunks/{dep-DnG211Xs.js → dep-5iBxKK6m.js} +12871 -6445
- package/dist/node/chunks/{dep-cpG-cLQR.js → dep-C0ketC3j.js} +1 -1
- package/dist/node/chunks/{dep-BH5K5NVS.js → dep-C1KLoAiP.js} +1 -1
- package/dist/node/cli.js +53 -35
- package/dist/node/constants.js +28 -1
- package/dist/node/index.d.ts +1926 -1913
- package/dist/node/index.js +6 -7
- package/dist/node-cjs/publicUtils.cjs +17 -0
- package/package.json +2 -2
- package/dist/node/chunks/dep-B2yOf3Tu.js +0 -6385
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { K as commonjsGlobal, J as getDefaultExportFromCjs } from './dep-5iBxKK6m.js';
|
2
2
|
import require$$0__default from 'fs';
|
3
3
|
import require$$0 from 'postcss';
|
4
4
|
import require$$0$1 from 'path';
|
package/dist/node/cli.js
CHANGED
@@ -2,19 +2,46 @@ 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 {
|
5
|
+
import { I as colors, A as createLogger, r as resolveConfig } from './chunks/dep-5iBxKK6m.js';
|
6
6
|
import { VERSION } from './constants.js';
|
7
|
-
import 'node:
|
7
|
+
import 'node:fs/promises';
|
8
|
+
import 'node:url';
|
9
|
+
import 'node:util';
|
10
|
+
import 'node:module';
|
8
11
|
import 'tty';
|
9
|
-
import '
|
12
|
+
import 'path';
|
13
|
+
import 'esbuild';
|
14
|
+
import 'fs';
|
15
|
+
import 'assert';
|
10
16
|
import 'node:child_process';
|
17
|
+
import 'node:http';
|
18
|
+
import 'node:https';
|
19
|
+
import 'util';
|
20
|
+
import 'net';
|
21
|
+
import 'url';
|
22
|
+
import 'http';
|
23
|
+
import 'stream';
|
24
|
+
import 'os';
|
25
|
+
import 'child_process';
|
26
|
+
import 'node:os';
|
11
27
|
import 'node:crypto';
|
12
|
-
import 'node:url';
|
13
|
-
import 'node:module';
|
14
28
|
import 'node:dns';
|
15
|
-
import '
|
16
|
-
import '
|
17
|
-
import '
|
29
|
+
import 'vite/module-runner';
|
30
|
+
import 'rollup/parseAst';
|
31
|
+
import 'module';
|
32
|
+
import 'node:assert';
|
33
|
+
import 'node:v8';
|
34
|
+
import 'node:worker_threads';
|
35
|
+
import 'node:events';
|
36
|
+
import 'crypto';
|
37
|
+
import 'querystring';
|
38
|
+
import 'node:buffer';
|
39
|
+
import 'node:readline';
|
40
|
+
import 'zlib';
|
41
|
+
import 'buffer';
|
42
|
+
import 'https';
|
43
|
+
import 'tls';
|
44
|
+
import 'node:zlib';
|
18
45
|
|
19
46
|
function toArr(any) {
|
20
47
|
return any == null ? [] : Array.isArray(any) ? any : [any];
|
@@ -739,7 +766,7 @@ cli
|
|
739
766
|
filterDuplicateOptions(options);
|
740
767
|
// output structure is preserved even after bundling so require()
|
741
768
|
// is ok here
|
742
|
-
const { createServer } = await import('./chunks/dep-
|
769
|
+
const { createServer } = await import('./chunks/dep-5iBxKK6m.js').then(function (n) { return n.M; });
|
743
770
|
try {
|
744
771
|
const server = await createServer({
|
745
772
|
root,
|
@@ -820,7 +847,7 @@ cli
|
|
820
847
|
.option('--app', `[boolean] same as builder.entireApp`)
|
821
848
|
.action(async (root, options) => {
|
822
849
|
filterDuplicateOptions(options);
|
823
|
-
const { createBuilder, buildEnvironment } = await import('./chunks/dep-
|
850
|
+
const { createBuilder, buildEnvironment } = await import('./chunks/dep-5iBxKK6m.js').then(function (n) { return n.N; });
|
824
851
|
const buildOptions = cleanGlobalCLIOptions(cleanBuilderCLIOptions(options));
|
825
852
|
const config = {
|
826
853
|
root,
|
@@ -860,31 +887,22 @@ cli
|
|
860
887
|
.command('optimize [root]', 'pre-bundle dependencies')
|
861
888
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
862
889
|
.action(async (root, options) => {
|
863
|
-
|
864
|
-
|
865
|
-
filterDuplicateOptions(options)
|
866
|
-
const { optimizeDeps } = await import('./optimizer')
|
890
|
+
filterDuplicateOptions(options);
|
891
|
+
const { optimizeDeps } = await import('./chunks/dep-5iBxKK6m.js').then(function (n) { return n.L; });
|
867
892
|
try {
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
}
|
881
|
-
createLogger(options.logLevel).error(
|
882
|
-
colors.red(`error when optimizing deps:\n${e.stack}`),
|
883
|
-
{ error: e },
|
884
|
-
)
|
885
|
-
process.exit(1)
|
886
|
-
}
|
887
|
-
*/
|
893
|
+
const config = await resolveConfig({
|
894
|
+
root,
|
895
|
+
base: options.base,
|
896
|
+
configFile: options.config,
|
897
|
+
logLevel: options.logLevel,
|
898
|
+
mode: options.mode,
|
899
|
+
}, 'serve');
|
900
|
+
await optimizeDeps(config, options.force, true);
|
901
|
+
}
|
902
|
+
catch (e) {
|
903
|
+
createLogger(options.logLevel).error(colors.red(`error when optimizing deps:\n${e.stack}`), { error: e });
|
904
|
+
process.exit(1);
|
905
|
+
}
|
888
906
|
});
|
889
907
|
// preview
|
890
908
|
cli
|
@@ -896,7 +914,7 @@ cli
|
|
896
914
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
897
915
|
.action(async (root, options) => {
|
898
916
|
filterDuplicateOptions(options);
|
899
|
-
const { preview } = await import('./chunks/dep-
|
917
|
+
const { preview } = await import('./chunks/dep-5iBxKK6m.js').then(function (n) { return n.O; });
|
900
918
|
try {
|
901
919
|
const server = await preview({
|
902
920
|
root,
|
package/dist/node/constants.js
CHANGED
@@ -3,6 +3,33 @@ import { fileURLToPath } from 'node:url';
|
|
3
3
|
import { readFileSync } from 'node:fs';
|
4
4
|
|
5
5
|
const { version } = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url)).toString());
|
6
|
+
const ROLLUP_HOOKS = [
|
7
|
+
'buildStart',
|
8
|
+
'buildEnd',
|
9
|
+
'renderStart',
|
10
|
+
'renderError',
|
11
|
+
'renderChunk',
|
12
|
+
'writeBundle',
|
13
|
+
'generateBundle',
|
14
|
+
'banner',
|
15
|
+
'footer',
|
16
|
+
'augmentChunkHash',
|
17
|
+
'outputOptions',
|
18
|
+
'renderDynamicImport',
|
19
|
+
'resolveFileUrl',
|
20
|
+
'resolveImportMeta',
|
21
|
+
'intro',
|
22
|
+
'outro',
|
23
|
+
'closeBundle',
|
24
|
+
'closeWatcher',
|
25
|
+
'load',
|
26
|
+
'moduleParsed',
|
27
|
+
'watchChange',
|
28
|
+
'resolveDynamicImport',
|
29
|
+
'resolveId',
|
30
|
+
'shouldTransformCachedModule',
|
31
|
+
'transform',
|
32
|
+
];
|
6
33
|
const VERSION = version;
|
7
34
|
const DEFAULT_MAIN_FIELDS = [
|
8
35
|
'browser',
|
@@ -112,4 +139,4 @@ const DEFAULT_PREVIEW_PORT = 4173;
|
|
112
139
|
const DEFAULT_ASSETS_INLINE_LIMIT = 4096;
|
113
140
|
const METADATA_FILENAME = '_metadata.json';
|
114
141
|
|
115
|
-
export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, CSS_LANGS_RE, DEFAULT_ASSETS_INLINE_LIMIT, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES, DEFAULT_DEV_PORT, DEFAULT_EXTENSIONS, DEFAULT_MAIN_FIELDS, DEFAULT_PREVIEW_PORT, DEP_VERSION_RE, ENV_ENTRY, ENV_PUBLIC_PATH, ESBUILD_MODULES_TARGET, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, METADATA_FILENAME, OPTIMIZABLE_ENTRY_RE, SPECIAL_QUERY_RE, VERSION, VITE_PACKAGE_DIR, loopbackHosts, wildcardHosts };
|
142
|
+
export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, CSS_LANGS_RE, DEFAULT_ASSETS_INLINE_LIMIT, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES, DEFAULT_DEV_PORT, DEFAULT_EXTENSIONS, DEFAULT_MAIN_FIELDS, DEFAULT_PREVIEW_PORT, DEP_VERSION_RE, ENV_ENTRY, ENV_PUBLIC_PATH, ESBUILD_MODULES_TARGET, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, METADATA_FILENAME, OPTIMIZABLE_ENTRY_RE, ROLLUP_HOOKS, SPECIAL_QUERY_RE, VERSION, VITE_PACKAGE_DIR, loopbackHosts, wildcardHosts };
|