vite 2.6.6 → 2.6.10

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 (82) hide show
  1. package/dist/node/chunks/{dep-8fc3d0a8.js → dep-8e7741a0.js} +2 -2
  2. package/dist/node/chunks/{dep-8fc3d0a8.js.map → dep-8e7741a0.js.map} +1 -1
  3. package/dist/node/chunks/{dep-6a58f2f7.js → dep-9b6b378f.js} +2 -2
  4. package/dist/node/chunks/{dep-6a58f2f7.js.map → dep-9b6b378f.js.map} +1 -1
  5. package/dist/node/chunks/{dep-da8087f5.js → dep-b502d052.js} +2 -2
  6. package/dist/node/chunks/{dep-da8087f5.js.map → dep-b502d052.js.map} +1 -1
  7. package/dist/node/chunks/{dep-713b45e1.js → dep-be032392.js} +59 -27
  8. package/dist/node/chunks/dep-be032392.js.map +1 -0
  9. package/dist/node/cli.js +4 -4
  10. package/dist/node/index.d.ts +517 -2
  11. package/dist/node/index.js +1 -1
  12. package/package.json +6 -6
  13. package/types/ws.d.ts +532 -0
  14. package/CHANGELOG.md +0 -2265
  15. package/dist/client/client.d.ts +0 -17
  16. package/dist/client/env.d.ts +0 -4
  17. package/dist/client/overlay.d.ts +0 -8
  18. package/dist/node/build.d.ts +0 -191
  19. package/dist/node/chunks/dep-1ee92c88.js +0 -10031
  20. package/dist/node/chunks/dep-1ee92c88.js.map +0 -1
  21. package/dist/node/chunks/dep-51d7aa64.js +0 -10032
  22. package/dist/node/chunks/dep-51d7aa64.js.map +0 -1
  23. package/dist/node/chunks/dep-713b45e1.js.map +0 -1
  24. package/dist/node/chunks/dep-e5804462.js +0 -10032
  25. package/dist/node/chunks/dep-e5804462.js.map +0 -1
  26. package/dist/node/cli.d.ts +0 -1
  27. package/dist/node/config.d.ts +0 -193
  28. package/dist/node/constants.d.ts +0 -27
  29. package/dist/node/importGlob.d.ts +0 -9
  30. package/dist/node/logger.d.ts +0 -28
  31. package/dist/node/optimizer/esbuildDepPlugin.d.ts +0 -4
  32. package/dist/node/optimizer/index.d.ts +0 -66
  33. package/dist/node/optimizer/registerMissing.d.ts +0 -2
  34. package/dist/node/optimizer/scan.d.ts +0 -9
  35. package/dist/node/plugin.d.ts +0 -110
  36. package/dist/node/plugins/asset.d.ts +0 -40
  37. package/dist/node/plugins/assetImportMetaUrl.d.ts +0 -13
  38. package/dist/node/plugins/clientInjections.d.ts +0 -7
  39. package/dist/node/plugins/css.d.ts +0 -68
  40. package/dist/node/plugins/dataUri.d.ts +0 -5
  41. package/dist/node/plugins/define.d.ts +0 -3
  42. package/dist/node/plugins/esbuild.d.ts +0 -15
  43. package/dist/node/plugins/html.d.ts +0 -74
  44. package/dist/node/plugins/importAnalysis.d.ts +0 -32
  45. package/dist/node/plugins/importAnalysisBuild.d.ts +0 -15
  46. package/dist/node/plugins/index.d.ts +0 -3
  47. package/dist/node/plugins/json.d.ts +0 -22
  48. package/dist/node/plugins/loadFallback.d.ts +0 -5
  49. package/dist/node/plugins/manifest.d.ts +0 -14
  50. package/dist/node/plugins/modulePreloadPolyfill.d.ts +0 -4
  51. package/dist/node/plugins/preAlias.d.ts +0 -5
  52. package/dist/node/plugins/reporter.d.ts +0 -3
  53. package/dist/node/plugins/resolve.d.ts +0 -51
  54. package/dist/node/plugins/terser.d.ts +0 -3
  55. package/dist/node/plugins/wasm.d.ts +0 -3
  56. package/dist/node/plugins/worker.d.ts +0 -3
  57. package/dist/node/preview.d.ts +0 -2
  58. package/dist/node/server/hmr.d.ts +0 -37
  59. package/dist/node/server/http.d.ts +0 -14
  60. package/dist/node/server/index.d.ts +0 -235
  61. package/dist/node/server/middlewares/base.d.ts +0 -3
  62. package/dist/node/server/middlewares/error.d.ts +0 -11
  63. package/dist/node/server/middlewares/indexHtml.d.ts +0 -4
  64. package/dist/node/server/middlewares/proxy.d.ts +0 -20
  65. package/dist/node/server/middlewares/spaFallback.d.ts +0 -2
  66. package/dist/node/server/middlewares/static.d.ts +0 -7
  67. package/dist/node/server/middlewares/time.d.ts +0 -2
  68. package/dist/node/server/middlewares/transform.d.ts +0 -3
  69. package/dist/node/server/moduleGraph.d.ts +0 -46
  70. package/dist/node/server/openBrowser.d.ts +0 -15
  71. package/dist/node/server/pluginContainer.d.ts +0 -27
  72. package/dist/node/server/searchRoot.d.ts +0 -8
  73. package/dist/node/server/send.d.ts +0 -4
  74. package/dist/node/server/sourcemap.d.ts +0 -8
  75. package/dist/node/server/transformRequest.d.ts +0 -14
  76. package/dist/node/server/ws.d.ts +0 -11
  77. package/dist/node/ssr/ssrExternal.d.ts +0 -10
  78. package/dist/node/ssr/ssrManifestPlugin.d.ts +0 -3
  79. package/dist/node/ssr/ssrModuleLoader.d.ts +0 -8
  80. package/dist/node/ssr/ssrStacktrace.d.ts +0 -3
  81. package/dist/node/ssr/ssrTransform.d.ts +0 -8
  82. package/dist/node/utils.d.ts +0 -90
@@ -1,15 +0,0 @@
1
- /**
2
- * The following is modified based on source found in
3
- * https://github.com/facebook/create-react-app
4
- *
5
- * MIT Licensed
6
- * Copyright (c) 2015-present, Facebook, Inc.
7
- * https://github.com/facebook/create-react-app/blob/master/LICENSE
8
- *
9
- */
10
- import { Logger } from '../logger';
11
- /**
12
- * Reads the BROWSER environment variable and decides what to do with it.
13
- * Returns true if it opened a browser or ran a node.js script, otherwise false.
14
- */
15
- export declare function openBrowser(url: string, opt: string | true, logger: Logger): boolean;
@@ -1,27 +0,0 @@
1
- /**
2
- * This file is refactored into TypeScript based on
3
- * https://github.com/preactjs/wmr/blob/main/packages/wmr/src/lib/rollup-plugin-container.js
4
- */
5
- import { Plugin } from '../plugin';
6
- import { InputOptions, OutputOptions, ModuleInfo, PartialResolvedId, LoadResult, SourceDescription } from 'rollup';
7
- import * as acorn from 'acorn';
8
- import { FSWatcher } from 'chokidar';
9
- import { ResolvedConfig } from '../config';
10
- export interface PluginContainerOptions {
11
- cwd?: string;
12
- output?: OutputOptions;
13
- modules?: Map<string, {
14
- info: ModuleInfo;
15
- }>;
16
- writeFile?: (name: string, source: string | Uint8Array) => void;
17
- }
18
- export interface PluginContainer {
19
- options: InputOptions;
20
- buildStart(options: InputOptions): Promise<void>;
21
- resolveId(id: string, importer?: string, skip?: Set<Plugin>, ssr?: boolean): Promise<PartialResolvedId | null>;
22
- transform(code: string, id: string, inMap?: SourceDescription['map'], ssr?: boolean): Promise<SourceDescription | null>;
23
- load(id: string, ssr?: boolean): Promise<LoadResult | null>;
24
- close(): Promise<void>;
25
- }
26
- export declare let parser: typeof acorn.Parser;
27
- export declare function createPluginContainer({ plugins, logger, root, build: { rollupOptions } }: ResolvedConfig, watcher?: FSWatcher): Promise<PluginContainer>;
@@ -1,8 +0,0 @@
1
- /**
2
- * Search up for the nearest `package.json`
3
- */
4
- export declare function searchForPackageRoot(current: string, root?: string): string;
5
- /**
6
- * Search up for the nearest workspace root
7
- */
8
- export declare function searchForWorkspaceRoot(current: string, root?: string): string;
@@ -1,4 +0,0 @@
1
- /// <reference types="node" />
2
- import { IncomingMessage, ServerResponse } from 'http';
3
- import { 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;
@@ -1,8 +0,0 @@
1
- import { Logger } from '../logger';
2
- interface SourceMapLike {
3
- sources: string[];
4
- sourcesContent?: (string | null)[];
5
- sourceRoot?: string;
6
- }
7
- export declare function injectSourcesContent(map: SourceMapLike, file: string, logger: Logger): Promise<void>;
8
- export {};
@@ -1,14 +0,0 @@
1
- import { SourceMap } from 'rollup';
2
- import { ViteDevServer } from '..';
3
- export interface TransformResult {
4
- code: string;
5
- map: SourceMap | null;
6
- etag?: string;
7
- deps?: string[];
8
- dynamicDeps?: string[];
9
- }
10
- export interface TransformOptions {
11
- ssr?: boolean;
12
- html?: boolean;
13
- }
14
- export declare function transformRequest(url: string, server: ViteDevServer, options?: TransformOptions): Promise<TransformResult | null>;
@@ -1,11 +0,0 @@
1
- /// <reference types="node" />
2
- import { Server } from 'http';
3
- import { ServerOptions as HttpsServerOptions } from 'https';
4
- import { HMRPayload } from 'types/hmrPayload';
5
- import { ResolvedConfig } from '..';
6
- export declare const HMR_HEADER = "vite-hmr";
7
- export interface WebSocketServer {
8
- send(payload: HMRPayload): void;
9
- close(): Promise<void>;
10
- }
11
- export declare function createWebSocketServer(server: Server | null, config: ResolvedConfig, httpsOptions?: HttpsServerOptions): WebSocketServer;
@@ -1,10 +0,0 @@
1
- import { ResolvedConfig } from '..';
2
- /**
3
- * Heuristics for determining whether a dependency should be externalized for
4
- * server-side rendering.
5
- *
6
- * TODO right now externals are imported using require(), we probably need to
7
- * rework this when more libraries ship native ESM distributions for Node.
8
- */
9
- export declare function resolveSSRExternal(config: ResolvedConfig, knownImports: string[], ssrExternals?: Set<string>, seen?: Set<string>): string[];
10
- export declare function shouldExternalizeForSSR(id: string, externals: string[]): boolean;
@@ -1,3 +0,0 @@
1
- import { ResolvedConfig } from '..';
2
- import { Plugin } from '../plugin';
3
- export declare function ssrManifestPlugin(config: ResolvedConfig): Plugin;
@@ -1,8 +0,0 @@
1
- /// <reference types="node" />
2
- import { ViteDevServer } from '..';
3
- interface SSRContext {
4
- global: NodeJS.Global;
5
- }
6
- declare type SSRModule = Record<string, any>;
7
- export declare function ssrLoadModule(url: string, server: ViteDevServer, context?: SSRContext, urlStack?: string[]): Promise<SSRModule>;
8
- export {};
@@ -1,3 +0,0 @@
1
- import { ModuleGraph } from '../server/moduleGraph';
2
- export declare function ssrRewriteStacktrace(stack: string, moduleGraph: ModuleGraph): string;
3
- export declare function rebindErrorStacktrace(e: Error, stacktrace: string): void;
@@ -1,8 +0,0 @@
1
- import { SourceMap } from 'rollup';
2
- import { TransformResult } from '../server/transformRequest';
3
- export declare const ssrModuleExportsKey = "__vite_ssr_exports__";
4
- export declare const ssrImportKey = "__vite_ssr_import__";
5
- export declare const ssrDynamicImportKey = "__vite_ssr_dynamic_import__";
6
- export declare const ssrExportAllKey = "__vite_ssr_exportAll__";
7
- export declare const ssrImportMetaKey = "__vite_ssr_import_meta__";
8
- export declare function ssrTransform(code: string, inMap: SourceMap | null, url: string): Promise<TransformResult | null>;
@@ -1,90 +0,0 @@
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 const bareImportRE: RegExp;
10
- export declare const deepImportRE: RegExp;
11
- export declare let isRunningWithYarnPnp: boolean;
12
- export declare function resolveFrom(id: string, basedir: string, preserveSymlinks?: boolean, ssr?: boolean): string;
13
- /**
14
- * like `resolveFrom` but supports resolving `>` path in `id`,
15
- * for example: `foo > bar > baz`
16
- */
17
- export declare function nestedResolveFrom(id: string, basedir: string, preserveSymlinks?: boolean): string;
18
- interface DebuggerOptions {
19
- onlyWhenFocused?: boolean | string;
20
- }
21
- export declare type ViteDebugScope = `vite:${string}`;
22
- export declare function createDebugger(namespace: ViteDebugScope, options?: DebuggerOptions): debug.Debugger['log'];
23
- export declare const isWindows: boolean;
24
- export declare function normalizePath(id: string): string;
25
- export declare function fsPathFromId(id: string): string;
26
- export declare function ensureVolumeInPath(file: string): string;
27
- export declare const queryRE: RegExp;
28
- export declare const hashRE: RegExp;
29
- export declare const cleanUrl: (url: string) => string;
30
- export declare const externalRE: RegExp;
31
- export declare const isExternalUrl: (url: string) => boolean;
32
- export declare const dataUrlRE: RegExp;
33
- export declare const isDataUrl: (url: string) => boolean;
34
- export declare const isJSRequest: (url: string) => boolean;
35
- export declare const isImportRequest: (url: string) => boolean;
36
- export declare const isInternalRequest: (url: string) => boolean;
37
- export declare function removeImportQuery(url: string): string;
38
- export declare function injectQuery(url: string, queryToInject: string): string;
39
- export declare function removeTimestampQuery(url: string): string;
40
- export declare function asyncReplace(input: string, re: RegExp, replacer: (match: RegExpExecArray) => string | Promise<string>): Promise<string>;
41
- export declare function timeFrom(start: number, subtract?: number): string;
42
- /**
43
- * pretty url for logging.
44
- */
45
- export declare function prettifyUrl(url: string, root: string): string;
46
- export declare function isObject(value: unknown): value is Record<string, any>;
47
- export declare function isDefined<T>(value: T | undefined | null): value is T;
48
- export declare function lookupFile(dir: string, formats: string[], pathOnly?: boolean): string | undefined;
49
- export declare function pad(source: string, n?: number): string;
50
- export declare function posToNumber(source: string, pos: number | {
51
- line: number;
52
- column: number;
53
- }): number;
54
- export declare function numberToPos(source: string, offset: number | {
55
- line: number;
56
- column: number;
57
- }): {
58
- line: number;
59
- column: number;
60
- };
61
- export declare function generateCodeFrame(source: string, start?: number | {
62
- line: number;
63
- column: number;
64
- }, end?: number): string;
65
- export declare function writeFile(filename: string, content: string | Uint8Array): void;
66
- /**
67
- * Delete every file and subdirectory. **The given directory must exist.**
68
- * Pass an optional `skip` array to preserve files in the root directory.
69
- */
70
- export declare function emptyDir(dir: string, skip?: string[]): void;
71
- export declare function copyDir(srcDir: string, destDir: string): void;
72
- export declare function ensureLeadingSlash(path: string): string;
73
- export declare function ensureWatchedFile(watcher: FSWatcher, file: string | null, root: string): void;
74
- interface ImageCandidate {
75
- url: string;
76
- descriptor: string;
77
- }
78
- export declare function processSrcSet(srcs: string, replacer: (arg: ImageCandidate) => Promise<string>): Promise<string>;
79
- export declare function combineSourcemaps(filename: string, sourcemapList: Array<DecodedSourceMap | RawSourceMap>): RawSourceMap;
80
- export declare function unique<T>(arr: T[]): T[];
81
- export interface Hostname {
82
- host: string | undefined;
83
- name: string;
84
- }
85
- export declare function resolveHostname(optionsHost: string | boolean | undefined): Hostname;
86
- export declare function arraify<T>(target: T | T[]): T[];
87
- export declare function toUpperCaseDriveLetter(pathName: string): string;
88
- export declare const multilineCommentsRE: RegExp;
89
- export declare const singlelineCommentsRE: RegExp;
90
- export {};