vite 2.7.8 → 2.8.0-beta.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.

Potentially problematic release.


This version of vite might be problematic. Click here for more details.

Files changed (36) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/LICENSE.md +2 -744
  3. package/dist/node/certificate.d.ts +2 -0
  4. package/dist/node/chunks/{dep-2d8e2cb1.js → dep-0ebab0df.js} +2 -2
  5. package/dist/node/chunks/{dep-2d8e2cb1.js.map → dep-0ebab0df.js.map} +1 -1
  6. package/dist/node/chunks/{dep-ac1b4bf9.js → dep-2056ae8a.js} +21 -4
  7. package/dist/node/chunks/dep-2056ae8a.js.map +1 -0
  8. package/dist/node/chunks/{dep-2d04f1e8.js → dep-51191982.js} +2 -2
  9. package/dist/node/chunks/{dep-2d04f1e8.js.map → dep-51191982.js.map} +1 -1
  10. package/dist/node/chunks/{dep-245e2712.js → dep-e4a9e288.js} +471 -4367
  11. package/dist/node/chunks/dep-e4a9e288.js.map +1 -0
  12. package/dist/node/chunks/{dep-24a6b4c4.js → dep-e4dc9ea2.js} +25993 -30439
  13. package/dist/node/chunks/dep-e4dc9ea2.js.map +1 -0
  14. package/dist/node/chunks/{dep-21eb5f0a.js → dep-fccf00e1.js} +8568 -17936
  15. package/dist/node/chunks/dep-fccf00e1.js.map +1 -0
  16. package/dist/node/cli.js +14 -12
  17. package/dist/node/cli.js.map +1 -1
  18. package/dist/node/config.d.ts +26 -1
  19. package/dist/node/http.d.ts +5 -1
  20. package/dist/node/importGlob.d.ts +5 -0
  21. package/dist/node/index.d.ts +50 -7
  22. package/dist/node/index.js +3 -2
  23. package/dist/node/index.js.map +1 -1
  24. package/dist/node/plugins/css.d.ts +2 -1
  25. package/dist/node/plugins/html.d.ts +7 -4
  26. package/dist/node/plugins/worker.d.ts +2 -0
  27. package/dist/node/plugins/workerImportMetaUrl.d.ts +3 -0
  28. package/dist/node/server/index.d.ts +7 -0
  29. package/dist/node/server/moduleGraph.d.ts +5 -5
  30. package/dist/node/server/send.d.ts +8 -2
  31. package/dist/node/utils.d.ts +1 -0
  32. package/package.json +13 -11
  33. package/dist/node/chunks/dep-21eb5f0a.js.map +0 -1
  34. package/dist/node/chunks/dep-245e2712.js.map +0 -1
  35. package/dist/node/chunks/dep-24a6b4c4.js.map +0 -1
  36. package/dist/node/chunks/dep-ac1b4bf9.js.map +0 -1
@@ -4,7 +4,7 @@ import type { OutputBundle, OutputChunk } from 'rollup';
4
4
  import type { ResolvedConfig } from '../config';
5
5
  import type { AttributeNode, NodeTransform, ElementNode } from '@vue/compiler-dom';
6
6
  export declare const isHTMLProxy: (id: string) => boolean;
7
- export declare const htmlProxyMap: WeakMap<Readonly<Omit<import("../config").UserConfig, "plugins" | "alias" | "dedupe" | "assetsInclude" | "optimizeDeps"> & {
7
+ export declare const htmlProxyMap: WeakMap<Readonly<Omit<import("../config").UserConfig, "plugins" | "alias" | "dedupe" | "assetsInclude" | "optimizeDeps" | "worker"> & {
8
8
  configFile: string | undefined;
9
9
  configFileDependencies: string[];
10
10
  inlineConfig: import("../config").InlineConfig;
@@ -27,12 +27,14 @@ export declare const htmlProxyMap: WeakMap<Readonly<Omit<import("../config").Use
27
27
  createResolver: (options?: Partial<import("./resolve").InternalResolveOptions> | undefined) => import("../config").ResolveFn;
28
28
  optimizeDeps: Omit<import("..").DepOptimizationOptions, "keepNames">;
29
29
  packageCache: import("..").PackageCache;
30
+ worker: import("../config").ResolveWorkerOptions;
30
31
  }>, Map<string, string[]>>;
31
- export declare function htmlInlineScriptProxyPlugin(config: ResolvedConfig): Plugin;
32
- /** Add script to cache */
32
+ export declare const htmlProxyResult: Map<string, string>;
33
+ export declare function htmlInlineProxyPlugin(config: ResolvedConfig): Plugin;
33
34
  export declare function addToHTMLProxyCache(config: ResolvedConfig, filePath: string, index: number, code: string): void;
35
+ export declare function addToHTMLProxyTransformResult(hash: string, code: string): void;
34
36
  export declare const assetAttrsConfig: Record<string, string[]>;
35
- export declare const isAsyncScriptMap: WeakMap<Readonly<Omit<import("../config").UserConfig, "plugins" | "alias" | "dedupe" | "assetsInclude" | "optimizeDeps"> & {
37
+ export declare const isAsyncScriptMap: WeakMap<Readonly<Omit<import("../config").UserConfig, "plugins" | "alias" | "dedupe" | "assetsInclude" | "optimizeDeps" | "worker"> & {
36
38
  configFile: string | undefined;
37
39
  configFileDependencies: string[];
38
40
  inlineConfig: import("../config").InlineConfig;
@@ -55,6 +57,7 @@ export declare const isAsyncScriptMap: WeakMap<Readonly<Omit<import("../config")
55
57
  createResolver: (options?: Partial<import("./resolve").InternalResolveOptions> | undefined) => import("../config").ResolveFn;
56
58
  optimizeDeps: Omit<import("..").DepOptimizationOptions, "keepNames">;
57
59
  packageCache: import("..").PackageCache;
60
+ worker: import("../config").ResolveWorkerOptions;
58
61
  }>, Map<string, boolean>>;
59
62
  export declare function traverseHtml(html: string, filePath: string, visitor: NodeTransform): Promise<void>;
60
63
  export declare function getScriptInfo(node: ElementNode): {
@@ -1,3 +1,5 @@
1
+ /// <reference types="node" />
1
2
  import type { ResolvedConfig } from '../config';
2
3
  import type { Plugin } from '../plugin';
4
+ export declare function bundleWorkerEntry(config: ResolvedConfig, id: string): Promise<Buffer>;
3
5
  export declare function webWorkerPlugin(config: ResolvedConfig): Plugin;
@@ -0,0 +1,3 @@
1
+ import type { ResolvedConfig } from '../config';
2
+ import type { Plugin } from '../plugin';
3
+ export declare function workerImportMetaUrlPlugin(config: ResolvedConfig): Plugin;
@@ -46,6 +46,13 @@ export interface ServerOptions extends CommonServerOptions {
46
46
  * Origin for the generated asset URLs.
47
47
  */
48
48
  origin?: string;
49
+ /**
50
+ * Pre-transform known direct imports
51
+ *
52
+ * @experimental this option is experimental and might be changed in the future
53
+ * @default true
54
+ */
55
+ preTransformRequests?: boolean;
49
56
  }
50
57
  export interface ResolvedServerOptions extends ServerOptions {
51
58
  fs: Required<FileSystemServeOptions>;
@@ -34,8 +34,8 @@ export declare class ModuleGraph {
34
34
  idToModuleMap: Map<string, ModuleNode>;
35
35
  fileToModulesMap: Map<string, Set<ModuleNode>>;
36
36
  safeModulesPath: Set<string>;
37
- constructor(resolveId: (url: string) => Promise<PartialResolvedId | null>);
38
- getModuleByUrl(rawUrl: string): Promise<ModuleNode | undefined>;
37
+ constructor(resolveId: (url: string, ssr: boolean) => Promise<PartialResolvedId | null>);
38
+ getModuleByUrl(rawUrl: string, ssr?: boolean): Promise<ModuleNode | undefined>;
39
39
  getModuleById(id: string): ModuleNode | undefined;
40
40
  getModulesByFile(file: string): Set<ModuleNode> | undefined;
41
41
  onFileChange(file: string): void;
@@ -46,8 +46,8 @@ export declare class ModuleGraph {
46
46
  * If there are dependencies that no longer have any importers, they are
47
47
  * returned as a Set.
48
48
  */
49
- updateModuleInfo(mod: ModuleNode, importedModules: Set<string | ModuleNode>, acceptedModules: Set<string | ModuleNode>, isSelfAccepting: boolean): Promise<Set<ModuleNode> | undefined>;
50
- ensureEntryFromUrl(rawUrl: string): Promise<ModuleNode>;
49
+ updateModuleInfo(mod: ModuleNode, importedModules: Set<string | ModuleNode>, acceptedModules: Set<string | ModuleNode>, isSelfAccepting: boolean, ssr?: boolean): Promise<Set<ModuleNode> | undefined>;
50
+ ensureEntryFromUrl(rawUrl: string, ssr?: boolean): Promise<ModuleNode>;
51
51
  createFileOnlyEntry(file: string): ModuleNode;
52
- resolveUrl(url: string): Promise<ResolvedUrl>;
52
+ resolveUrl(url: string, ssr?: boolean): Promise<ResolvedUrl>;
53
53
  }
@@ -1,4 +1,10 @@
1
1
  /// <reference types="node" />
2
- import type { IncomingMessage, ServerResponse } from 'http';
2
+ import type { IncomingMessage, OutgoingHttpHeaders, ServerResponse } from 'http';
3
3
  import type { SourceMap } from 'rollup';
4
- export declare function send(req: IncomingMessage, res: ServerResponse, content: string | Buffer, type: string, etag?: string, cacheControl?: string, map?: SourceMap | null): void;
4
+ export interface SendOptions {
5
+ etag?: string;
6
+ cacheControl?: string;
7
+ headers?: OutgoingHttpHeaders;
8
+ map?: SourceMap | null;
9
+ }
10
+ export declare function send(req: IncomingMessage, res: ServerResponse, content: string | Buffer, type: string, options: SendOptions): void;
@@ -111,4 +111,5 @@ export declare const usingDynamicImport: boolean;
111
111
  * @param file File path to import.
112
112
  */
113
113
  export declare const dynamicImport: Function;
114
+ export declare function parseRequest(id: string): Record<string, string> | null;
114
115
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "2.7.8",
3
+ "version": "2.8.0-beta.1",
4
4
  "license": "MIT",
5
5
  "author": "Evan You",
6
6
  "description": "Native-ESM powered web dev build tool",
@@ -44,7 +44,8 @@
44
44
  },
45
45
  "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
46
46
  "dependencies": {
47
- "esbuild": "^0.13.12",
47
+ "esbuild": "0.14.3",
48
+ "json5": "^2.2.0",
48
49
  "postcss": "^8.4.5",
49
50
  "resolve": "^1.20.0",
50
51
  "rollup": "^2.59.0"
@@ -58,19 +59,20 @@
58
59
  "@babel/types": "^7.16.0",
59
60
  "@rollup/plugin-alias": "^3.1.8",
60
61
  "@rollup/plugin-commonjs": "^21.0.1",
61
- "@rollup/plugin-dynamic-import-vars": "^1.4.1",
62
+ "@rollup/plugin-dynamic-import-vars": "^1.4.2",
62
63
  "@rollup/plugin-json": "^4.1.0",
63
64
  "@rollup/plugin-node-resolve": "13.1.1",
64
65
  "@rollup/plugin-typescript": "^8.3.0",
65
66
  "@rollup/pluginutils": "^4.1.2",
66
67
  "@types/convert-source-map": "^1.5.2",
68
+ "@types/cross-spawn": "^6.0.2",
67
69
  "@types/debug": "^4.1.7",
68
70
  "@types/estree": "^0.0.50",
69
71
  "@types/etag": "^1.8.1",
70
72
  "@types/less": "^3.0.3",
71
73
  "@types/micromatch": "^4.0.2",
72
74
  "@types/mime": "^2.0.3",
73
- "@types/node": "^16.11.14",
75
+ "@types/node": "^16.11.17",
74
76
  "@types/resolve": "^1.20.1",
75
77
  "@types/sass": "~1.43.1",
76
78
  "@types/stylus": "^0.48.36",
@@ -78,36 +80,36 @@
78
80
  "@vue/compiler-dom": "^3.2.26",
79
81
  "acorn": "^8.7.0",
80
82
  "cac": "6.7.9",
81
- "chalk": "^4.1.2",
82
83
  "chokidar": "^3.5.2",
83
84
  "compression": "^1.7.4",
84
85
  "connect": "^3.7.0",
85
86
  "connect-history-api-fallback": "^1.6.0",
86
87
  "convert-source-map": "^1.8.0",
87
88
  "cors": "^2.8.5",
89
+ "cross-spawn": "^7.0.3",
88
90
  "debug": "^4.3.3",
89
91
  "dotenv": "^10.0.0",
90
92
  "dotenv-expand": "^5.1.0",
91
93
  "es-module-lexer": "^0.9.3",
92
94
  "estree-walker": "^2.0.2",
93
95
  "etag": "^1.8.1",
94
- "execa": "^5.1.1",
95
96
  "fast-glob": "^3.2.7",
96
97
  "http-proxy": "^1.18.1",
97
98
  "launch-editor-middleware": "^2.3.0",
98
99
  "magic-string": "^0.25.7",
99
100
  "micromatch": "^4.0.4",
100
- "mime": "^3.0.0",
101
+ "mrmime": "^1.0.0",
102
+ "node-forge": "^0.10.0",
101
103
  "okie": "^1.0.1",
102
104
  "open": "^8.4.0",
103
105
  "periscopic": "^2.0.3",
106
+ "picocolors": "^1.0.0",
104
107
  "postcss-import": "^14.0.2",
105
108
  "postcss-load-config": "^3.1.0",
106
- "postcss-modules": "^4.2.2",
109
+ "postcss-modules": "^4.3.0",
107
110
  "resolve.exports": "^1.1.0",
108
111
  "rollup-plugin-license": "^2.6.0",
109
- "selfsigned": "^1.10.11",
110
- "sirv": "^1.0.19",
112
+ "sirv": "^2.0.0",
111
113
  "source-map": "^0.6.1",
112
114
  "source-map-support": "^0.5.21",
113
115
  "strip-ansi": "^6.0.1",
@@ -115,7 +117,7 @@
115
117
  "tsconfck": "1.1.1",
116
118
  "tslib": "^2.3.1",
117
119
  "types": "link:./types",
118
- "ws": "^8.3.0"
120
+ "ws": "^8.4.0"
119
121
  },
120
122
  "peerDependencies": {
121
123
  "less": "*",