vite 2.7.1 → 2.7.2
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.
Potentially problematic release.
This version of vite might be problematic. Click here for more details.
- package/CHANGELOG.md +11 -0
- package/dist/node/build.d.ts +200 -0
- package/dist/node/chunks/{dep-51488e9f.js → dep-453486e7.js} +2 -2
- package/dist/node/chunks/{dep-51488e9f.js.map → dep-453486e7.js.map} +1 -1
- package/dist/node/chunks/{dep-3daf770c.js → dep-7817f5b4.js} +125 -27
- package/dist/node/chunks/dep-7817f5b4.js.map +1 -0
- package/dist/node/chunks/{dep-8ff556de.js → dep-93096c54.js} +2 -2
- package/dist/node/chunks/{dep-8ff556de.js.map → dep-93096c54.js.map} +1 -1
- package/dist/node/chunks/{dep-76c973d0.js → dep-fffc0487.js} +2 -2
- package/dist/node/chunks/{dep-76c973d0.js.map → dep-fffc0487.js.map} +1 -1
- package/dist/node/cli.d.ts +1 -0
- package/dist/node/cli.js +4 -4
- package/dist/node/cli.js.map +1 -1
- package/dist/node/config.d.ts +202 -0
- package/dist/node/constants.d.ts +33 -0
- package/dist/node/http.d.ts +84 -0
- package/dist/node/importGlob.d.ts +9 -0
- package/dist/node/index.d.ts +275 -280
- package/dist/node/index.js +1 -1
- package/dist/node/logger.d.ts +35 -0
- package/dist/node/optimizer/esbuildDepPlugin.d.ts +4 -0
- package/dist/node/optimizer/index.d.ts +66 -0
- package/dist/node/optimizer/registerMissing.d.ts +2 -0
- package/dist/node/optimizer/scan.d.ts +9 -0
- package/dist/node/packages.d.ts +25 -0
- package/dist/node/plugin.d.ts +115 -0
- package/dist/node/plugins/asset.d.ts +40 -0
- package/dist/node/plugins/assetImportMetaUrl.d.ts +13 -0
- package/dist/node/plugins/clientInjections.d.ts +7 -0
- package/dist/node/plugins/css.d.ts +72 -0
- package/dist/node/plugins/dataUri.d.ts +5 -0
- package/dist/node/plugins/define.d.ts +3 -0
- package/dist/node/plugins/esbuild.d.ts +15 -0
- package/dist/node/plugins/html.d.ts +102 -0
- package/dist/node/plugins/importAnalysis.d.ts +46 -0
- package/dist/node/plugins/importAnalysisBuild.d.ts +15 -0
- package/dist/node/plugins/index.d.ts +3 -0
- package/dist/node/plugins/json.d.ts +22 -0
- package/dist/node/plugins/loadFallback.d.ts +5 -0
- package/dist/node/plugins/manifest.d.ts +14 -0
- package/dist/node/plugins/modulePreloadPolyfill.d.ts +4 -0
- package/dist/node/plugins/preAlias.d.ts +5 -0
- package/dist/node/plugins/reporter.d.ts +3 -0
- package/dist/node/plugins/resolve.d.ts +38 -0
- package/dist/node/plugins/ssrRequireHook.d.ts +12 -0
- package/dist/node/plugins/terser.d.ts +3 -0
- package/dist/node/plugins/wasm.d.ts +3 -0
- package/dist/node/plugins/worker.d.ts +3 -0
- package/dist/node/preview.d.ts +31 -0
- package/dist/node/server/hmr.d.ts +37 -0
- package/dist/node/server/index.d.ts +214 -0
- package/dist/node/server/middlewares/base.d.ts +3 -0
- package/dist/node/server/middlewares/error.d.ts +8 -0
- package/dist/node/server/middlewares/indexHtml.d.ts +4 -0
- package/dist/node/server/middlewares/proxy.d.ts +20 -0
- package/dist/node/server/middlewares/spaFallback.d.ts +2 -0
- package/dist/node/server/middlewares/static.d.ts +6 -0
- package/dist/node/server/middlewares/time.d.ts +2 -0
- package/dist/node/server/middlewares/transform.d.ts +3 -0
- package/dist/node/server/moduleGraph.d.ts +53 -0
- package/dist/node/server/openBrowser.d.ts +15 -0
- package/dist/node/server/pluginContainer.d.ts +37 -0
- package/dist/node/server/searchRoot.d.ts +8 -0
- package/dist/node/server/send.d.ts +4 -0
- package/dist/node/server/sourcemap.d.ts +8 -0
- package/dist/node/server/transformRequest.d.ts +14 -0
- package/dist/node/server/ws.d.ts +14 -0
- package/dist/node/ssr/ssrExternal.d.ts +7 -0
- package/dist/node/ssr/ssrManifestPlugin.d.ts +3 -0
- package/dist/node/ssr/ssrModuleLoader.d.ts +7 -0
- package/dist/node/ssr/ssrStacktrace.d.ts +3 -0
- package/dist/node/ssr/ssrTransform.d.ts +8 -0
- package/dist/node/utils.d.ts +114 -0
- package/package.json +3 -3
- package/types/ws.d.ts +277 -281
- package/dist/node/chunks/dep-3daf770c.js.map +0 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import debug from 'debug';
|
|
2
|
+
import { FSWatcher } from 'chokidar';
|
|
3
|
+
import { DecodedSourceMap, RawSourceMap } from '@ampproject/remapping/dist/types/types';
|
|
4
|
+
export declare function slash(p: string): string;
|
|
5
|
+
export declare function unwrapId(id: string): string;
|
|
6
|
+
export declare const flattenId: (id: string) => string;
|
|
7
|
+
export declare const normalizeId: (id: string) => string;
|
|
8
|
+
export declare function isBuiltin(id: string): boolean;
|
|
9
|
+
export declare function moduleListContains(moduleList: string[] | undefined, id: string): boolean | undefined;
|
|
10
|
+
export declare const bareImportRE: RegExp;
|
|
11
|
+
export declare const deepImportRE: RegExp;
|
|
12
|
+
export declare let isRunningWithYarnPnp: boolean;
|
|
13
|
+
export declare function resolveFrom(id: string, basedir: string, preserveSymlinks?: boolean, ssr?: boolean): string;
|
|
14
|
+
/**
|
|
15
|
+
* like `resolveFrom` but supports resolving `>` path in `id`,
|
|
16
|
+
* for example: `foo > bar > baz`
|
|
17
|
+
*/
|
|
18
|
+
export declare function nestedResolveFrom(id: string, basedir: string, preserveSymlinks?: boolean): string;
|
|
19
|
+
interface DebuggerOptions {
|
|
20
|
+
onlyWhenFocused?: boolean | string;
|
|
21
|
+
}
|
|
22
|
+
export declare type ViteDebugScope = `vite:${string}`;
|
|
23
|
+
export declare function createDebugger(namespace: ViteDebugScope, options?: DebuggerOptions): debug.Debugger['log'];
|
|
24
|
+
export declare const isWindows: boolean;
|
|
25
|
+
export declare function normalizePath(id: string): string;
|
|
26
|
+
export declare function fsPathFromId(id: string): string;
|
|
27
|
+
export declare function ensureVolumeInPath(file: string): string;
|
|
28
|
+
export declare const queryRE: RegExp;
|
|
29
|
+
export declare const hashRE: RegExp;
|
|
30
|
+
export declare const cleanUrl: (url: string) => string;
|
|
31
|
+
export declare const externalRE: RegExp;
|
|
32
|
+
export declare const isExternalUrl: (url: string) => boolean;
|
|
33
|
+
export declare const dataUrlRE: RegExp;
|
|
34
|
+
export declare const isDataUrl: (url: string) => boolean;
|
|
35
|
+
export declare const virtualModuleRE: RegExp;
|
|
36
|
+
export declare const virtualModulePrefix = "virtual-module:";
|
|
37
|
+
export declare const isJSRequest: (url: string) => boolean;
|
|
38
|
+
export declare const isTsRequest: (url: string) => boolean;
|
|
39
|
+
export declare const isPossibleTsOutput: (url: string) => boolean;
|
|
40
|
+
export declare const getTsSrcPath: (filename: string) => string;
|
|
41
|
+
export declare const isImportRequest: (url: string) => boolean;
|
|
42
|
+
export declare const isInternalRequest: (url: string) => boolean;
|
|
43
|
+
export declare function removeImportQuery(url: string): string;
|
|
44
|
+
export declare function injectQuery(url: string, queryToInject: string): string;
|
|
45
|
+
export declare function removeTimestampQuery(url: string): string;
|
|
46
|
+
export declare function asyncReplace(input: string, re: RegExp, replacer: (match: RegExpExecArray) => string | Promise<string>): Promise<string>;
|
|
47
|
+
export declare function timeFrom(start: number, subtract?: number): string;
|
|
48
|
+
/**
|
|
49
|
+
* pretty url for logging.
|
|
50
|
+
*/
|
|
51
|
+
export declare function prettifyUrl(url: string, root: string): string;
|
|
52
|
+
export declare function isObject(value: unknown): value is Record<string, any>;
|
|
53
|
+
export declare function isDefined<T>(value: T | undefined | null): value is T;
|
|
54
|
+
export declare function lookupFile(dir: string, formats: string[], pathOnly?: boolean): string | undefined;
|
|
55
|
+
export declare function pad(source: string, n?: number): string;
|
|
56
|
+
export declare function posToNumber(source: string, pos: number | {
|
|
57
|
+
line: number;
|
|
58
|
+
column: number;
|
|
59
|
+
}): number;
|
|
60
|
+
export declare function numberToPos(source: string, offset: number | {
|
|
61
|
+
line: number;
|
|
62
|
+
column: number;
|
|
63
|
+
}): {
|
|
64
|
+
line: number;
|
|
65
|
+
column: number;
|
|
66
|
+
};
|
|
67
|
+
export declare function generateCodeFrame(source: string, start?: number | {
|
|
68
|
+
line: number;
|
|
69
|
+
column: number;
|
|
70
|
+
}, end?: number): string;
|
|
71
|
+
export declare function writeFile(filename: string, content: string | Uint8Array): void;
|
|
72
|
+
/**
|
|
73
|
+
* Use instead of fs.existsSync(filename)
|
|
74
|
+
* #2051 if we don't have read permission on a directory, existsSync() still
|
|
75
|
+
* works and will result in massively slow subsequent checks (which are
|
|
76
|
+
* unnecessary in the first place)
|
|
77
|
+
*/
|
|
78
|
+
export declare function isFileReadable(filename: string): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Delete every file and subdirectory. **The given directory must exist.**
|
|
81
|
+
* Pass an optional `skip` array to preserve files in the root directory.
|
|
82
|
+
*/
|
|
83
|
+
export declare function emptyDir(dir: string, skip?: string[]): void;
|
|
84
|
+
export declare function copyDir(srcDir: string, destDir: string): void;
|
|
85
|
+
export declare function ensureLeadingSlash(path: string): string;
|
|
86
|
+
export declare function ensureWatchedFile(watcher: FSWatcher, file: string | null, root: string): void;
|
|
87
|
+
interface ImageCandidate {
|
|
88
|
+
url: string;
|
|
89
|
+
descriptor: string;
|
|
90
|
+
}
|
|
91
|
+
export declare function processSrcSet(srcs: string, replacer: (arg: ImageCandidate) => Promise<string>): Promise<string>;
|
|
92
|
+
export declare function combineSourcemaps(filename: string, sourcemapList: Array<DecodedSourceMap | RawSourceMap>): RawSourceMap;
|
|
93
|
+
export declare function unique<T>(arr: T[]): T[];
|
|
94
|
+
export interface Hostname {
|
|
95
|
+
host: string | undefined;
|
|
96
|
+
name: string;
|
|
97
|
+
}
|
|
98
|
+
export declare function resolveHostname(optionsHost: string | boolean | undefined): Hostname;
|
|
99
|
+
export declare function arraify<T>(target: T | T[]): T[];
|
|
100
|
+
export declare function toUpperCaseDriveLetter(pathName: string): string;
|
|
101
|
+
export declare const multilineCommentsRE: RegExp;
|
|
102
|
+
export declare const singlelineCommentsRE: RegExp;
|
|
103
|
+
export declare const usingDynamicImport: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Dynamically import files. It will make sure it's not being compiled away by TS/Rollup.
|
|
106
|
+
*
|
|
107
|
+
* As a temporary workaround for Jest's lack of stable ESM support, we fallback to require
|
|
108
|
+
* if we're in a Jest environment.
|
|
109
|
+
* See https://github.com/vitejs/vite/pull/5197#issuecomment-938054077
|
|
110
|
+
*
|
|
111
|
+
* @param file File path to import.
|
|
112
|
+
*/
|
|
113
|
+
export declare const dynamicImport: Function;
|
|
114
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Evan You",
|
|
6
6
|
"description": "Native-ESM powered web dev build tool",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@types/resolve": "^1.20.1",
|
|
75
75
|
"@types/sass": "~1.43.0",
|
|
76
76
|
"@types/stylus": "^0.48.36",
|
|
77
|
-
"@types/ws": "^8.2.
|
|
77
|
+
"@types/ws": "^8.2.2",
|
|
78
78
|
"@vue/compiler-dom": "^3.2.22",
|
|
79
79
|
"acorn": "^8.6.0",
|
|
80
80
|
"acorn-class-fields": "^1.0.0",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"tsconfck": "1.1.1",
|
|
118
118
|
"tslib": "^2.3.1",
|
|
119
119
|
"types": "link:./types",
|
|
120
|
-
"ws": "^8.
|
|
120
|
+
"ws": "^8.3.0"
|
|
121
121
|
},
|
|
122
122
|
"peerDependencies": {
|
|
123
123
|
"less": "*",
|