vite 3.0.0-alpha.5 → 3.0.0-alpha.8
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/node/chunks/{dep-21067347.js → dep-6b269949.js} +1 -1
- package/dist/node/chunks/{dep-0232e200.js → dep-8250f392.js} +422 -200
- package/dist/node/chunks/{dep-cd161504.js → dep-8259d5f4.js} +1 -1
- package/dist/node/chunks/{dep-13a14c32.js → dep-cfa39351.js} +1 -1
- package/dist/node/cli.js +5 -5
- package/dist/node/constants.js +1 -1
- package/dist/node/index.d.ts +40 -4
- package/dist/node/index.js +1 -1
- package/dist/node-cjs/publicUtils.cjs +1 -1
- package/dist/node-cjs/terser.cjs +1023 -2876
- package/package.json +11 -10
- package/dist/node/build.d.ts +0 -178
- package/dist/node/certificate.d.ts +0 -2
- package/dist/node/cli.d.ts +0 -1
- package/dist/node/config.d.ts +0 -246
- package/dist/node/constants.d.ts +0 -35
- package/dist/node/env.d.ts +0 -3
- package/dist/node/http.d.ts +0 -88
- package/dist/node/logger.d.ts +0 -31
- package/dist/node/optimizer/esbuildDepPlugin.d.ts +0 -4
- package/dist/node/optimizer/index.d.ts +0 -181
- package/dist/node/optimizer/optimizer.d.ts +0 -4
- package/dist/node/optimizer/scan.d.ts +0 -8
- package/dist/node/packages.d.ts +0 -27
- package/dist/node/plugin.d.ts +0 -130
- package/dist/node/plugins/asset.d.ts +0 -68
- package/dist/node/plugins/assetImportMetaUrl.d.ts +0 -13
- package/dist/node/plugins/clientInjections.d.ts +0 -7
- package/dist/node/plugins/css.d.ts +0 -86
- package/dist/node/plugins/dataUri.d.ts +0 -5
- package/dist/node/plugins/define.d.ts +0 -3
- package/dist/node/plugins/dynamicImportVars.d.ts +0 -9
- package/dist/node/plugins/ensureWatch.d.ts +0 -5
- package/dist/node/plugins/esbuild.d.ts +0 -15
- package/dist/node/plugins/html.d.ts +0 -120
- package/dist/node/plugins/importAnalysis.d.ts +0 -47
- package/dist/node/plugins/importAnalysisBuild.d.ts +0 -16
- package/dist/node/plugins/importMetaGlob.d.ts +0 -34
- package/dist/node/plugins/index.d.ts +0 -3
- package/dist/node/plugins/json.d.ts +0 -23
- package/dist/node/plugins/loadFallback.d.ts +0 -5
- package/dist/node/plugins/manifest.d.ts +0 -14
- package/dist/node/plugins/metadata.d.ts +0 -9
- package/dist/node/plugins/modulePreloadPolyfill.d.ts +0 -4
- package/dist/node/plugins/optimizedDeps.d.ts +0 -7
- package/dist/node/plugins/preAlias.d.ts +0 -6
- package/dist/node/plugins/reporter.d.ts +0 -3
- package/dist/node/plugins/resolve.d.ts +0 -41
- package/dist/node/plugins/splitVendorChunk.d.ts +0 -12
- package/dist/node/plugins/ssrRequireHook.d.ts +0 -12
- package/dist/node/plugins/terser.d.ts +0 -3
- package/dist/node/plugins/wasm.d.ts +0 -4
- package/dist/node/plugins/worker.d.ts +0 -9
- package/dist/node/plugins/workerImportMetaUrl.d.ts +0 -3
- package/dist/node/preview.d.ts +0 -33
- package/dist/node/publicUtils.d.ts +0 -11
- package/dist/node/server/hmr.d.ts +0 -39
- package/dist/node/server/index.d.ts +0 -189
- package/dist/node/server/middlewares/base.d.ts +0 -3
- package/dist/node/server/middlewares/compression.d.ts +0 -1
- package/dist/node/server/middlewares/error.d.ts +0 -8
- package/dist/node/server/middlewares/indexHtml.d.ts +0 -4
- package/dist/node/server/middlewares/proxy.d.ts +0 -20
- package/dist/node/server/middlewares/spaFallback.d.ts +0 -2
- package/dist/node/server/middlewares/static.d.ts +0 -6
- package/dist/node/server/middlewares/time.d.ts +0 -2
- package/dist/node/server/middlewares/transform.d.ts +0 -3
- package/dist/node/server/moduleGraph.d.ts +0 -55
- package/dist/node/server/openBrowser.d.ts +0 -15
- package/dist/node/server/pluginContainer.d.ts +0 -41
- package/dist/node/server/searchRoot.d.ts +0 -8
- package/dist/node/server/send.d.ts +0 -10
- package/dist/node/server/sourcemap.d.ts +0 -11
- package/dist/node/server/transformRequest.d.ts +0 -14
- package/dist/node/server/ws.d.ts +0 -55
- package/dist/node/ssr/ssrExternal.d.ts +0 -11
- package/dist/node/ssr/ssrManifestPlugin.d.ts +0 -3
- package/dist/node/ssr/ssrModuleLoader.d.ts +0 -7
- package/dist/node/ssr/ssrStacktrace.d.ts +0 -3
- package/dist/node/ssr/ssrTransform.d.ts +0 -14
- package/dist/node/utils.d.ts +0 -144
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import type { OutputBundle, OutputChunk, SourceMapInput } from 'rollup';
|
|
2
|
-
import type { AttributeNode, ElementNode, NodeTransform } from '@vue/compiler-dom';
|
|
3
|
-
import type { Plugin } from '../plugin';
|
|
4
|
-
import type { ViteDevServer } from '../server';
|
|
5
|
-
import type { ResolvedConfig } from '../config';
|
|
6
|
-
export declare const isHTMLProxy: (id: string) => boolean;
|
|
7
|
-
export declare const isHTMLRequest: (request: string) => boolean;
|
|
8
|
-
export declare const htmlProxyMap: WeakMap<Readonly<Omit<import("../config").UserConfig, "assetsInclude" | "plugins" | "optimizeDeps" | "worker"> & {
|
|
9
|
-
configFile: string | undefined;
|
|
10
|
-
configFileDependencies: string[];
|
|
11
|
-
inlineConfig: import("../config").InlineConfig;
|
|
12
|
-
root: string;
|
|
13
|
-
base: string;
|
|
14
|
-
publicDir: string;
|
|
15
|
-
cacheDir: string;
|
|
16
|
-
command: "build" | "serve";
|
|
17
|
-
mode: string;
|
|
18
|
-
isWorker: boolean;
|
|
19
|
-
mainConfig: Readonly<Omit<import("../config").UserConfig, "assetsInclude" | "plugins" | "optimizeDeps" | "worker"> & any> | null;
|
|
20
|
-
isProduction: boolean;
|
|
21
|
-
env: Record<string, any>;
|
|
22
|
-
resolve: import("./resolve").ResolveOptions & {
|
|
23
|
-
alias: import("types/alias").Alias[];
|
|
24
|
-
};
|
|
25
|
-
plugins: readonly Plugin[];
|
|
26
|
-
server: import("../server").ResolvedServerOptions;
|
|
27
|
-
build: Required<import("..").BuildOptions>;
|
|
28
|
-
preview: import("..").ResolvedPreviewOptions;
|
|
29
|
-
assetsInclude: (file: string) => boolean;
|
|
30
|
-
logger: import("..").Logger;
|
|
31
|
-
createResolver: (options?: Partial<import("./resolve").InternalResolveOptions> | undefined) => import("../config").ResolveFn;
|
|
32
|
-
optimizeDeps: import("..").DepOptimizationOptions;
|
|
33
|
-
packageCache: import("..").PackageCache;
|
|
34
|
-
worker: import("../config").ResolveWorkerOptions;
|
|
35
|
-
spa: boolean;
|
|
36
|
-
}>, Map<string, {
|
|
37
|
-
code: string;
|
|
38
|
-
map?: SourceMapInput | undefined;
|
|
39
|
-
}[]>>;
|
|
40
|
-
export declare const htmlProxyResult: Map<string, string>;
|
|
41
|
-
export declare function htmlInlineProxyPlugin(config: ResolvedConfig): Plugin;
|
|
42
|
-
export declare function addToHTMLProxyCache(config: ResolvedConfig, filePath: string, index: number, result: {
|
|
43
|
-
code: string;
|
|
44
|
-
map?: SourceMapInput;
|
|
45
|
-
}): void;
|
|
46
|
-
export declare function addToHTMLProxyTransformResult(hash: string, code: string): void;
|
|
47
|
-
export declare const assetAttrsConfig: Record<string, string[]>;
|
|
48
|
-
export declare const isAsyncScriptMap: WeakMap<Readonly<Omit<import("../config").UserConfig, "assetsInclude" | "plugins" | "optimizeDeps" | "worker"> & {
|
|
49
|
-
configFile: string | undefined;
|
|
50
|
-
configFileDependencies: string[];
|
|
51
|
-
inlineConfig: import("../config").InlineConfig;
|
|
52
|
-
root: string;
|
|
53
|
-
base: string;
|
|
54
|
-
publicDir: string;
|
|
55
|
-
cacheDir: string;
|
|
56
|
-
command: "build" | "serve";
|
|
57
|
-
mode: string;
|
|
58
|
-
isWorker: boolean;
|
|
59
|
-
mainConfig: Readonly<Omit<import("../config").UserConfig, "assetsInclude" | "plugins" | "optimizeDeps" | "worker"> & any> | null;
|
|
60
|
-
isProduction: boolean;
|
|
61
|
-
env: Record<string, any>;
|
|
62
|
-
resolve: import("./resolve").ResolveOptions & {
|
|
63
|
-
alias: import("types/alias").Alias[];
|
|
64
|
-
};
|
|
65
|
-
plugins: readonly Plugin[];
|
|
66
|
-
server: import("../server").ResolvedServerOptions;
|
|
67
|
-
build: Required<import("..").BuildOptions>;
|
|
68
|
-
preview: import("..").ResolvedPreviewOptions;
|
|
69
|
-
assetsInclude: (file: string) => boolean;
|
|
70
|
-
logger: import("..").Logger;
|
|
71
|
-
createResolver: (options?: Partial<import("./resolve").InternalResolveOptions> | undefined) => import("../config").ResolveFn;
|
|
72
|
-
optimizeDeps: import("..").DepOptimizationOptions;
|
|
73
|
-
packageCache: import("..").PackageCache;
|
|
74
|
-
worker: import("../config").ResolveWorkerOptions;
|
|
75
|
-
spa: boolean;
|
|
76
|
-
}>, Map<string, boolean>>;
|
|
77
|
-
export declare function traverseHtml(html: string, filePath: string, visitor: NodeTransform): Promise<void>;
|
|
78
|
-
export declare function getScriptInfo(node: ElementNode): {
|
|
79
|
-
src: AttributeNode | undefined;
|
|
80
|
-
isModule: boolean;
|
|
81
|
-
isAsync: boolean;
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* Compiles index.html into an entry js module
|
|
85
|
-
*/
|
|
86
|
-
export declare function buildHtmlPlugin(config: ResolvedConfig): Plugin;
|
|
87
|
-
export interface HtmlTagDescriptor {
|
|
88
|
-
tag: string;
|
|
89
|
-
attrs?: Record<string, string | boolean | undefined>;
|
|
90
|
-
children?: string | HtmlTagDescriptor[];
|
|
91
|
-
/**
|
|
92
|
-
* default: 'head-prepend'
|
|
93
|
-
*/
|
|
94
|
-
injectTo?: 'head' | 'body' | 'head-prepend' | 'body-prepend';
|
|
95
|
-
}
|
|
96
|
-
export declare type IndexHtmlTransformResult = string | HtmlTagDescriptor[] | {
|
|
97
|
-
html: string;
|
|
98
|
-
tags: HtmlTagDescriptor[];
|
|
99
|
-
};
|
|
100
|
-
export interface IndexHtmlTransformContext {
|
|
101
|
-
/**
|
|
102
|
-
* public path when served
|
|
103
|
-
*/
|
|
104
|
-
path: string;
|
|
105
|
-
/**
|
|
106
|
-
* filename on disk
|
|
107
|
-
*/
|
|
108
|
-
filename: string;
|
|
109
|
-
server?: ViteDevServer;
|
|
110
|
-
bundle?: OutputBundle;
|
|
111
|
-
chunk?: OutputChunk;
|
|
112
|
-
originalUrl?: string;
|
|
113
|
-
}
|
|
114
|
-
export declare type IndexHtmlTransformHook = (html: string, ctx: IndexHtmlTransformContext) => IndexHtmlTransformResult | void | Promise<IndexHtmlTransformResult | void>;
|
|
115
|
-
export declare type IndexHtmlTransform = IndexHtmlTransformHook | {
|
|
116
|
-
enforce?: 'pre' | 'post';
|
|
117
|
-
transform: IndexHtmlTransformHook;
|
|
118
|
-
};
|
|
119
|
-
export declare function resolveHtmlTransforms(plugins: readonly Plugin[]): [IndexHtmlTransformHook[], IndexHtmlTransformHook[]];
|
|
120
|
-
export declare function applyHtmlTransforms(html: string, hooks: IndexHtmlTransformHook[], ctx: IndexHtmlTransformContext): Promise<string>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { ResolvedConfig } from '../config';
|
|
2
|
-
import type { Plugin } from '../plugin';
|
|
3
|
-
export declare const canSkipImportAnalysis: (id: string) => boolean;
|
|
4
|
-
/**
|
|
5
|
-
* Server-only plugin that lexes, resolves, rewrites and analyzes url imports.
|
|
6
|
-
*
|
|
7
|
-
* - Imports are resolved to ensure they exist on disk
|
|
8
|
-
*
|
|
9
|
-
* - Lexes HMR accept calls and updates import relationships in the module graph
|
|
10
|
-
*
|
|
11
|
-
* - Bare module imports are resolved (by @rollup-plugin/node-resolve) to
|
|
12
|
-
* absolute file paths, e.g.
|
|
13
|
-
*
|
|
14
|
-
* ```js
|
|
15
|
-
* import 'foo'
|
|
16
|
-
* ```
|
|
17
|
-
* is rewritten to
|
|
18
|
-
* ```js
|
|
19
|
-
* import '/@fs//project/node_modules/foo/dist/foo.js'
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* - CSS imports are appended with `.js` since both the js module and the actual
|
|
23
|
-
* css (referenced via <link>) may go through the transform pipeline:
|
|
24
|
-
*
|
|
25
|
-
* ```js
|
|
26
|
-
* import './style.css'
|
|
27
|
-
* ```
|
|
28
|
-
* is rewritten to
|
|
29
|
-
* ```js
|
|
30
|
-
* import './style.css.js'
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export declare function importAnalysisPlugin(config: ResolvedConfig): Plugin;
|
|
34
|
-
/**
|
|
35
|
-
* Detect import statements to a known optimized CJS dependency and provide
|
|
36
|
-
* ES named imports interop. We do this by rewriting named imports to a variable
|
|
37
|
-
* assignment to the corresponding property on the `module.exports` of the cjs
|
|
38
|
-
* module. Note this doesn't support dynamic re-assignments from within the cjs
|
|
39
|
-
* module.
|
|
40
|
-
*
|
|
41
|
-
* Note that es-module-lexer treats `export * from '...'` as an import as well,
|
|
42
|
-
* so, we may encounter ExportAllDeclaration here, in which case `undefined`
|
|
43
|
-
* will be returned.
|
|
44
|
-
*
|
|
45
|
-
* Credits \@csr632 via #837
|
|
46
|
-
*/
|
|
47
|
-
export declare function transformCjsImport(importExp: string, url: string, rawUrl: string, importIndex: number): string | undefined;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from '../plugin';
|
|
2
|
-
import type { ResolvedConfig } from '../config';
|
|
3
|
-
/**
|
|
4
|
-
* A flag for injected helpers. This flag will be set to `false` if the output
|
|
5
|
-
* target is not native es - so that injected helper logic can be conditionally
|
|
6
|
-
* dropped.
|
|
7
|
-
*/
|
|
8
|
-
export declare const isModernFlag = "__VITE_IS_MODERN__";
|
|
9
|
-
export declare const preloadMethod = "__vitePreload";
|
|
10
|
-
export declare const preloadMarker = "__VITE_PRELOAD__";
|
|
11
|
-
export declare const preloadBaseMarker = "__VITE_PRELOAD_BASE__";
|
|
12
|
-
export declare const preloadHelperId = "\0vite/preload-helper";
|
|
13
|
-
/**
|
|
14
|
-
* Build only. During serve this is performed as part of ./importAnalysis.
|
|
15
|
-
*/
|
|
16
|
-
export declare function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import MagicString from 'magic-string';
|
|
2
|
-
import type { GeneralImportGlobOptions } from 'types/importGlob';
|
|
3
|
-
import type { Plugin } from '../plugin';
|
|
4
|
-
import type { ViteDevServer } from '../server';
|
|
5
|
-
import type { ModuleNode } from '../server/moduleGraph';
|
|
6
|
-
import type { ResolvedConfig } from '../config';
|
|
7
|
-
export interface ParsedImportGlob {
|
|
8
|
-
match: RegExpMatchArray;
|
|
9
|
-
index: number;
|
|
10
|
-
globs: string[];
|
|
11
|
-
globsResolved: string[];
|
|
12
|
-
isRelative: boolean;
|
|
13
|
-
options: GeneralImportGlobOptions;
|
|
14
|
-
type: string;
|
|
15
|
-
start: number;
|
|
16
|
-
end: number;
|
|
17
|
-
}
|
|
18
|
-
export declare function getAffectedGlobModules(file: string, server: ViteDevServer): ModuleNode[];
|
|
19
|
-
export declare function importGlobPlugin(config: ResolvedConfig): Plugin;
|
|
20
|
-
export declare function parseImportGlob(code: string, importer: string | undefined, root: string, resolveId: IdResolver): Promise<ParsedImportGlob[]>;
|
|
21
|
-
export interface TransformGlobImportResult {
|
|
22
|
-
s: MagicString;
|
|
23
|
-
matches: ParsedImportGlob[];
|
|
24
|
-
files: Set<string>;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* @param optimizeExport for dynamicImportVar plugin don't need to optimize export.
|
|
28
|
-
*/
|
|
29
|
-
export declare function transformGlobImport(code: string, id: string, root: string, resolveId: IdResolver, restoreQueryExtension?: boolean): Promise<TransformGlobImportResult | null>;
|
|
30
|
-
declare type IdResolver = (id: string, importer?: string) => Promise<string | undefined> | string | undefined;
|
|
31
|
-
export declare function toAbsoluteGlob(glob: string, root: string, importer: string | undefined, resolveId: IdResolver): Promise<string>;
|
|
32
|
-
export declare function getCommonBase(globsResolved: string[]): null | string;
|
|
33
|
-
export declare function isVirtualModule(id: string): boolean;
|
|
34
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* https://github.com/rollup/plugins/blob/master/packages/json/src/index.js
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file at
|
|
6
|
-
* https://github.com/rollup/plugins/blob/master/LICENSE
|
|
7
|
-
*/
|
|
8
|
-
import type { Plugin } from '../plugin';
|
|
9
|
-
export interface JsonOptions {
|
|
10
|
-
/**
|
|
11
|
-
* Generate a named export for every property of the JSON object
|
|
12
|
-
* @default true
|
|
13
|
-
*/
|
|
14
|
-
namedExports?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Generate performant output as JSON.parse("stringified").
|
|
17
|
-
* Enabling this will disable namedExports.
|
|
18
|
-
* @default false
|
|
19
|
-
*/
|
|
20
|
-
stringify?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export declare const isJSONRequest: (request: string) => boolean;
|
|
23
|
-
export declare function jsonPlugin(options: JsonOptions | undefined, isBuild: boolean): Plugin;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ResolvedConfig } from '..';
|
|
2
|
-
import type { Plugin } from '../plugin';
|
|
3
|
-
export declare type Manifest = Record<string, ManifestChunk>;
|
|
4
|
-
export interface ManifestChunk {
|
|
5
|
-
src?: string;
|
|
6
|
-
file: string;
|
|
7
|
-
css?: string[];
|
|
8
|
-
assets?: string[];
|
|
9
|
-
isEntry?: boolean;
|
|
10
|
-
isDynamicEntry?: boolean;
|
|
11
|
-
imports?: string[];
|
|
12
|
-
dynamicImports?: string[];
|
|
13
|
-
}
|
|
14
|
-
export declare function manifestPlugin(config: ResolvedConfig): Plugin;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from '../plugin';
|
|
2
|
-
export interface ChunkMetadata {
|
|
3
|
-
importedAssets: Set<string>;
|
|
4
|
-
importedCss: Set<string>;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Prepares the rendered chunks to contain additional metadata during build.
|
|
8
|
-
*/
|
|
9
|
-
export declare function metadataPlugin(): Plugin;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ResolvedConfig } from '..';
|
|
2
|
-
import type { Plugin } from '../plugin';
|
|
3
|
-
export declare const ERR_OPTIMIZE_DEPS_PROCESSING_ERROR = "ERR_OPTIMIZE_DEPS_PROCESSING_ERROR";
|
|
4
|
-
export declare const ERR_OUTDATED_OPTIMIZED_DEP = "ERR_OUTDATED_OPTIMIZED_DEP";
|
|
5
|
-
export declare function registerWorkersSource(config: ResolvedConfig, id: string): void;
|
|
6
|
-
export declare function optimizedDepsPlugin(config: ResolvedConfig): Plugin;
|
|
7
|
-
export declare function optimizedDepsBuildPlugin(config: ResolvedConfig): Plugin;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { PartialResolvedId } from 'rollup';
|
|
2
|
-
import type { Plugin } from '../plugin';
|
|
3
|
-
import type { DepsOptimizer } from '../optimizer';
|
|
4
|
-
import type { SSROptions } from '..';
|
|
5
|
-
import type { PackageCache, PackageData } from '../packages';
|
|
6
|
-
export declare const browserExternalId = "__vite-browser-external";
|
|
7
|
-
export interface ResolveOptions {
|
|
8
|
-
mainFields?: string[];
|
|
9
|
-
conditions?: string[];
|
|
10
|
-
extensions?: string[];
|
|
11
|
-
dedupe?: string[];
|
|
12
|
-
preserveSymlinks?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export interface InternalResolveOptions extends ResolveOptions {
|
|
15
|
-
root: string;
|
|
16
|
-
isBuild: boolean;
|
|
17
|
-
isProduction: boolean;
|
|
18
|
-
ssrConfig?: SSROptions;
|
|
19
|
-
packageCache?: PackageCache;
|
|
20
|
-
/**
|
|
21
|
-
* src code mode also attempts the following:
|
|
22
|
-
* - resolving /xxx as URLs
|
|
23
|
-
* - resolving bare imports from optimized deps
|
|
24
|
-
*/
|
|
25
|
-
asSrc?: boolean;
|
|
26
|
-
tryIndex?: boolean;
|
|
27
|
-
tryPrefix?: string;
|
|
28
|
-
skipPackageJson?: boolean;
|
|
29
|
-
preferRelative?: boolean;
|
|
30
|
-
preserveSymlinks?: boolean;
|
|
31
|
-
isRequire?: boolean;
|
|
32
|
-
isFromTsImporter?: boolean;
|
|
33
|
-
tryEsmOnly?: boolean;
|
|
34
|
-
scan?: boolean;
|
|
35
|
-
getDepsOptimizer?: () => DepsOptimizer | undefined;
|
|
36
|
-
}
|
|
37
|
-
export declare function resolvePlugin(baseOptions: InternalResolveOptions): Plugin;
|
|
38
|
-
export declare const idToPkgMap: Map<string, PackageData>;
|
|
39
|
-
export declare function tryNodeResolve(id: string, importer: string | null | undefined, options: InternalResolveOptions, targetWeb: boolean, depsOptimizer?: DepsOptimizer, ssr?: boolean): PartialResolvedId | undefined;
|
|
40
|
-
export declare function tryOptimizedResolve(depsOptimizer: DepsOptimizer, id: string, importer?: string): Promise<string | undefined>;
|
|
41
|
-
export declare function resolvePackageEntry(id: string, { dir, data, setResolvedCache, getResolvedCache }: PackageData, targetWeb: boolean, options: InternalResolveOptions): string | undefined;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { GetManualChunk } from 'rollup';
|
|
2
|
-
import type { Plugin } from '../plugin';
|
|
3
|
-
export declare const isCSSRequest: (request: string) => boolean;
|
|
4
|
-
export declare class SplitVendorChunkCache {
|
|
5
|
-
cache: Map<string, boolean>;
|
|
6
|
-
constructor();
|
|
7
|
-
reset(): void;
|
|
8
|
-
}
|
|
9
|
-
export declare function splitVendorChunk(options?: {
|
|
10
|
-
cache?: SplitVendorChunkCache;
|
|
11
|
-
}): GetManualChunk;
|
|
12
|
-
export declare function splitVendorChunkPlugin(): Plugin;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import type { ResolvedConfig } from '..';
|
|
3
|
-
import type { Plugin } from '../plugin';
|
|
4
|
-
/**
|
|
5
|
-
* This plugin hooks into Node's module resolution algorithm at runtime,
|
|
6
|
-
* so that SSR builds can benefit from `resolve.dedupe` like they do
|
|
7
|
-
* in development.
|
|
8
|
-
*/
|
|
9
|
-
export declare function ssrRequireHookPlugin(config: ResolvedConfig): Plugin | null;
|
|
10
|
-
declare type NodeResolveFilename = (request: string, parent: NodeModule, isMain: boolean, options?: Record<string, any>) => string;
|
|
11
|
-
export declare function hookNodeResolve(getResolver: (resolveFilename: NodeResolveFilename) => NodeResolveFilename): () => void;
|
|
12
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { OutputChunk } from 'rollup';
|
|
2
|
-
import type { ResolvedConfig } from '../config';
|
|
3
|
-
import type { Plugin } from '../plugin';
|
|
4
|
-
export declare type WorkerType = 'classic' | 'module' | 'ignore';
|
|
5
|
-
export declare const WORKER_FILE_ID = "worker_file";
|
|
6
|
-
export declare function bundleWorkerEntry(config: ResolvedConfig, id: string, query: Record<string, string> | null): Promise<OutputChunk>;
|
|
7
|
-
export declare const workerAssetUrlRE: RegExp;
|
|
8
|
-
export declare function workerFileToUrl(config: ResolvedConfig, id: string, query: Record<string, string> | null): Promise<string>;
|
|
9
|
-
export declare function webWorkerPlugin(config: ResolvedConfig): Plugin;
|
package/dist/node/preview.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import type * as http from 'http';
|
|
3
|
-
import type { Connect } from 'types/connect';
|
|
4
|
-
import type { ResolvedServerOptions } from './server';
|
|
5
|
-
import type { CommonServerOptions } from './http';
|
|
6
|
-
import type { InlineConfig, ResolvedConfig } from '.';
|
|
7
|
-
export interface PreviewOptions extends CommonServerOptions {
|
|
8
|
-
}
|
|
9
|
-
export interface ResolvedPreviewOptions extends PreviewOptions {
|
|
10
|
-
}
|
|
11
|
-
export declare function resolvePreviewOptions(preview: PreviewOptions | undefined, server: ResolvedServerOptions): ResolvedPreviewOptions;
|
|
12
|
-
export interface PreviewServer {
|
|
13
|
-
/**
|
|
14
|
-
* The resolved vite config object
|
|
15
|
-
*/
|
|
16
|
-
config: ResolvedConfig;
|
|
17
|
-
/**
|
|
18
|
-
* native Node http server instance
|
|
19
|
-
*/
|
|
20
|
-
httpServer: http.Server;
|
|
21
|
-
/**
|
|
22
|
-
* Print server urls
|
|
23
|
-
*/
|
|
24
|
-
printUrls: () => void;
|
|
25
|
-
}
|
|
26
|
-
export declare type PreviewServerHook = (server: {
|
|
27
|
-
middlewares: Connect.Server;
|
|
28
|
-
httpServer: http.Server;
|
|
29
|
-
}) => (() => void) | void | Promise<(() => void) | void>;
|
|
30
|
-
/**
|
|
31
|
-
* Starts the Vite server in preview mode, to simulate a production deployment
|
|
32
|
-
*/
|
|
33
|
-
export declare function preview(inlineConfig?: InlineConfig): Promise<PreviewServer>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Exported sync utils should go here.
|
|
3
|
-
* This file will be bundled to ESM and CJS and redirected by ../index.cjs
|
|
4
|
-
* Please control the side-effects by checking the ./dist/node-cjs/publicUtils.cjs bundle
|
|
5
|
-
*/
|
|
6
|
-
export { splitVendorChunkPlugin, splitVendorChunk } from './plugins/splitVendorChunk';
|
|
7
|
-
export { normalizePath, mergeConfig, mergeAlias } from './utils';
|
|
8
|
-
export { send } from './server/send';
|
|
9
|
-
export { createLogger } from './logger';
|
|
10
|
-
export { searchForWorkspaceRoot } from './server/searchRoot';
|
|
11
|
-
export { loadEnv, resolveEnvPrefix } from './env';
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import type { Server } from 'http';
|
|
3
|
-
import type { ViteDevServer } from '..';
|
|
4
|
-
import type { ModuleNode } from './moduleGraph';
|
|
5
|
-
export declare const debugHmr: (...args: any[]) => any;
|
|
6
|
-
export interface HmrOptions {
|
|
7
|
-
protocol?: string;
|
|
8
|
-
host?: string;
|
|
9
|
-
port?: number;
|
|
10
|
-
clientPort?: number;
|
|
11
|
-
path?: string;
|
|
12
|
-
timeout?: number;
|
|
13
|
-
overlay?: boolean;
|
|
14
|
-
server?: Server;
|
|
15
|
-
}
|
|
16
|
-
export interface HmrContext {
|
|
17
|
-
file: string;
|
|
18
|
-
timestamp: number;
|
|
19
|
-
modules: Array<ModuleNode>;
|
|
20
|
-
read: () => string | Promise<string>;
|
|
21
|
-
server: ViteDevServer;
|
|
22
|
-
}
|
|
23
|
-
export declare function getShortName(file: string, root: string): string;
|
|
24
|
-
export declare function handleHMRUpdate(file: string, server: ViteDevServer): Promise<any>;
|
|
25
|
-
export declare function updateModules(file: string, modules: ModuleNode[], timestamp: number, { config, ws }: ViteDevServer): void;
|
|
26
|
-
export declare function handleFileAddUnlink(file: string, server: ViteDevServer): Promise<void>;
|
|
27
|
-
export declare function handlePrunedModules(mods: Set<ModuleNode>, { ws }: ViteDevServer): void;
|
|
28
|
-
/**
|
|
29
|
-
* Lex import.meta.hot.accept() for accepted deps.
|
|
30
|
-
* Since hot.accept() can only accept string literals or array of string
|
|
31
|
-
* literals, we don't really need a heavy @babel/parse call on the entire source.
|
|
32
|
-
*
|
|
33
|
-
* @returns selfAccepts
|
|
34
|
-
*/
|
|
35
|
-
export declare function lexAcceptedHmrDeps(code: string, start: number, urls: Set<{
|
|
36
|
-
url: string;
|
|
37
|
-
start: number;
|
|
38
|
-
end: number;
|
|
39
|
-
}>): boolean;
|