vite 5.0.0-beta.12 → 5.0.0-beta.14
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 -29
- package/dist/node/chunks/{dep-cjQQUT93.js → dep-L-2yzs6m.js} +1 -1
- package/dist/node/chunks/{dep-BF1HzV2j.js → dep-OMqKnqdS.js} +1 -1
- package/dist/node/chunks/{dep-poYMMaJ-.js → dep-QFst3FNH.js} +22591 -22466
- package/dist/node/cli.js +28 -29
- package/dist/node/constants.js +1 -0
- package/dist/node/index.d.ts +13 -11
- package/dist/node/index.js +2 -2
- package/package.json +7 -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 { 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-QFst3FNH.js';
|
|
6
6
|
import { VERSION } from './constants.js';
|
|
7
7
|
import 'node:fs/promises';
|
|
8
8
|
import 'node:url';
|
|
@@ -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-QFst3FNH.js').then(function (n) { return n.A; });
|
|
763
763
|
try {
|
|
764
764
|
const server = await createServer({
|
|
765
765
|
root,
|
|
@@ -785,33 +785,32 @@ cli
|
|
|
785
785
|
!globalThis.__vite_cjs_skip_clear_screen,
|
|
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-QFst3FNH.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-QFst3FNH.js').then(function (n) { return n.B; });
|
|
872
871
|
try {
|
|
873
872
|
const config = await resolveConfig({
|
|
874
873
|
root,
|
|
@@ -894,7 +893,7 @@ cli
|
|
|
894
893
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
|
895
894
|
.action(async (root, options) => {
|
|
896
895
|
filterDuplicateOptions(options);
|
|
897
|
-
const { preview } = await import('./chunks/dep-
|
|
896
|
+
const { preview } = await import('./chunks/dep-QFst3FNH.js').then(function (n) { return n.D; });
|
|
898
897
|
try {
|
|
899
898
|
const server = await preview({
|
|
900
899
|
root,
|
package/dist/node/constants.js
CHANGED
package/dist/node/index.d.ts
CHANGED
|
@@ -738,10 +738,14 @@ declare function preview(inlineConfig?: InlineConfig): Promise<PreviewServer>;
|
|
|
738
738
|
|
|
739
739
|
type BindCLIShortcutsOptions<Server = ViteDevServer | PreviewServer> = {
|
|
740
740
|
/**
|
|
741
|
-
* Print a one
|
|
741
|
+
* Print a one-line shortcuts "help" hint to the terminal
|
|
742
742
|
*/
|
|
743
743
|
print?: boolean;
|
|
744
|
-
|
|
744
|
+
/**
|
|
745
|
+
* Custom shortcuts to run when a key is pressed. These shortcuts take priority
|
|
746
|
+
* over the default shortcuts if they have the same keys (except the `h` key).
|
|
747
|
+
*/
|
|
748
|
+
customShortcuts?: CLIShortcut<Server>[];
|
|
745
749
|
};
|
|
746
750
|
type CLIShortcut<Server = ViteDevServer | PreviewServer> = {
|
|
747
751
|
key: string;
|
|
@@ -811,14 +815,17 @@ declare class ModuleGraph {
|
|
|
811
815
|
getModuleById(id: string): ModuleNode | undefined;
|
|
812
816
|
getModulesByFile(file: string): Set<ModuleNode> | undefined;
|
|
813
817
|
onFileChange(file: string): void;
|
|
814
|
-
invalidateModule(mod: ModuleNode, seen?: Set<ModuleNode>, timestamp?: number, isHmr?: boolean, hmrBoundaries?: ModuleNode[]): void;
|
|
818
|
+
invalidateModule(mod: ModuleNode, seen?: Set<ModuleNode>, timestamp?: number, isHmr?: boolean, hmrBoundaries?: ModuleNode[], softInvalidate?: boolean): void;
|
|
815
819
|
invalidateAll(): void;
|
|
816
820
|
/**
|
|
817
821
|
* Update the module graph based on a module's updated imports information
|
|
818
822
|
* If there are dependencies that no longer have any importers, they are
|
|
819
823
|
* returned as a Set.
|
|
824
|
+
*
|
|
825
|
+
* @param staticImportedUrls Subset of `importedModules` where they're statically imported in code.
|
|
826
|
+
* This is only used for soft invalidations so `undefined` is fine but may cause more runtime processing.
|
|
820
827
|
*/
|
|
821
|
-
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>;
|
|
828
|
+
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, staticImportedUrls?: Set<string>): Promise<Set<ModuleNode> | undefined>;
|
|
822
829
|
ensureEntryFromUrl(rawUrl: string, ssr?: boolean, setIsSelfAccepting?: boolean): Promise<ModuleNode>;
|
|
823
830
|
createFileOnlyEntry(file: string): ModuleNode;
|
|
824
831
|
resolveUrl(url: string, ssr?: boolean): Promise<ResolvedUrl>;
|
|
@@ -1483,7 +1490,7 @@ interface ServerOptions extends CommonServerOptions {
|
|
|
1483
1490
|
* Create Vite dev server to be used as a middleware in an existing server
|
|
1484
1491
|
* @default false
|
|
1485
1492
|
*/
|
|
1486
|
-
middlewareMode?: boolean
|
|
1493
|
+
middlewareMode?: boolean;
|
|
1487
1494
|
/**
|
|
1488
1495
|
* Options for files served via '/\@fs/'.
|
|
1489
1496
|
*/
|
|
@@ -2592,14 +2599,9 @@ interface ResolvedSSROptions extends SSROptions {
|
|
|
2592
2599
|
|
|
2593
2600
|
interface ResolveOptions {
|
|
2594
2601
|
/**
|
|
2595
|
-
* @default ['module', 'jsnext:main', 'jsnext']
|
|
2602
|
+
* @default ['browser', 'module', 'jsnext:main', 'jsnext']
|
|
2596
2603
|
*/
|
|
2597
2604
|
mainFields?: string[];
|
|
2598
|
-
/**
|
|
2599
|
-
* @deprecated In future, `mainFields` should be used instead.
|
|
2600
|
-
* @default true
|
|
2601
|
-
*/
|
|
2602
|
-
browserField?: boolean;
|
|
2603
2605
|
conditions?: string[];
|
|
2604
2606
|
/**
|
|
2605
2607
|
* @default ['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']
|
package/dist/node/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as isInNodeModules } from './chunks/dep-
|
|
2
|
-
export { b as build, e as buildErrorMessage, h as createFilter, k as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, u as isFileServingAllowed, l as loadConfigFromFile, v as loadEnv, g as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, r as resolveConfig, w as resolveEnvPrefix, q as searchForWorkspaceRoot, j as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
|
1
|
+
import { i as isInNodeModules } from './chunks/dep-QFst3FNH.js';
|
|
2
|
+
export { b as build, e as buildErrorMessage, h as createFilter, k as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, u as isFileServingAllowed, l as loadConfigFromFile, v as loadEnv, g as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, r as resolveConfig, w as resolveEnvPrefix, q as searchForWorkspaceRoot, j as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-QFst3FNH.js';
|
|
3
3
|
export { VERSION as version } from './constants.js';
|
|
4
4
|
export { version as esbuildVersion } from 'esbuild';
|
|
5
5
|
export { VERSION as rollupVersion } from 'rollup';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Evan You",
|
|
@@ -70,22 +70,21 @@
|
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@ampproject/remapping": "^2.2.1",
|
|
73
|
-
"@jridgewell/trace-mapping": "^0.3.
|
|
73
|
+
"@jridgewell/trace-mapping": "^0.3.20",
|
|
74
74
|
"@rollup/plugin-alias": "^5.0.1",
|
|
75
75
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
76
|
-
"@rollup/plugin-dynamic-import-vars": "^2.0
|
|
76
|
+
"@rollup/plugin-dynamic-import-vars": "^2.1.0",
|
|
77
77
|
"@rollup/plugin-json": "^6.0.1",
|
|
78
78
|
"@rollup/plugin-node-resolve": "15.2.3",
|
|
79
79
|
"@rollup/plugin-typescript": "^11.1.5",
|
|
80
80
|
"@rollup/pluginutils": "^5.0.5",
|
|
81
|
-
"@types/escape-html": "^1.0.
|
|
82
|
-
"@types/pnpapi": "^0.0.
|
|
83
|
-
"acorn": "^8.
|
|
84
|
-
"acorn-walk": "^8.
|
|
81
|
+
"@types/escape-html": "^1.0.3",
|
|
82
|
+
"@types/pnpapi": "^0.0.4",
|
|
83
|
+
"acorn": "^8.11.2",
|
|
84
|
+
"acorn-walk": "^8.3.0",
|
|
85
85
|
"cac": "^6.7.14",
|
|
86
86
|
"chokidar": "^3.5.3",
|
|
87
87
|
"connect": "^3.7.0",
|
|
88
|
-
"connect-history-api-fallback": "^2.0.0",
|
|
89
88
|
"convert-source-map": "^2.0.0",
|
|
90
89
|
"cors": "^2.8.5",
|
|
91
90
|
"cross-spawn": "^7.0.3",
|