vite 2.7.3 → 2.7.7

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 (87) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/LICENSE.md +41 -11
  3. package/dist/client/client.mjs +1 -1
  4. package/dist/client/client.mjs.map +1 -1
  5. package/dist/node/build.d.ts +6 -6
  6. package/dist/node/chunks/{dep-58399509.js → dep-2d8e2cb1.js} +1 -1
  7. package/dist/node/chunks/dep-2d8e2cb1.js.map +1 -0
  8. package/dist/node/chunks/{dep-5496817b.js → dep-4a9cff06.js} +505 -167
  9. package/dist/node/chunks/dep-4a9cff06.js.map +1 -0
  10. package/dist/node/chunks/{dep-cf2decec.js → dep-591fce67.js} +2 -2
  11. package/dist/node/chunks/dep-591fce67.js.map +1 -0
  12. package/dist/node/chunks/{dep-df937e9b.js → dep-67730f16.js} +2 -2
  13. package/dist/node/chunks/{dep-df937e9b.js.map → dep-67730f16.js.map} +1 -1
  14. package/dist/node/chunks/{dep-66abeb03.js → dep-f41a1db3.js} +79 -61
  15. package/dist/node/chunks/dep-f41a1db3.js.map +1 -0
  16. package/dist/node/cli.js +4 -4
  17. package/dist/node/cli.js.map +1 -1
  18. package/dist/node/config.d.ts +14 -14
  19. package/dist/node/http.d.ts +5 -5
  20. package/dist/node/index.d.ts +44 -44
  21. package/dist/node/index.js +1 -1
  22. package/dist/node/logger.d.ts +4 -4
  23. package/dist/node/optimizer/esbuildDepPlugin.d.ts +3 -3
  24. package/dist/node/optimizer/index.d.ts +2 -2
  25. package/dist/node/optimizer/registerMissing.d.ts +1 -1
  26. package/dist/node/optimizer/scan.d.ts +1 -1
  27. package/dist/node/packages.d.ts +2 -2
  28. package/dist/node/plugin.d.ts +7 -7
  29. package/dist/node/plugins/asset.d.ts +3 -3
  30. package/dist/node/plugins/assetImportMetaUrl.d.ts +2 -2
  31. package/dist/node/plugins/clientInjections.d.ts +2 -2
  32. package/dist/node/plugins/css.d.ts +7 -9
  33. package/dist/node/plugins/dataUri.d.ts +1 -1
  34. package/dist/node/plugins/define.d.ts +2 -2
  35. package/dist/node/plugins/esbuild.d.ts +4 -4
  36. package/dist/node/plugins/html.d.ts +5 -5
  37. package/dist/node/plugins/importAnalysis.d.ts +2 -2
  38. package/dist/node/plugins/importAnalysisBuild.d.ts +2 -2
  39. package/dist/node/plugins/index.d.ts +2 -2
  40. package/dist/node/plugins/json.d.ts +1 -1
  41. package/dist/node/plugins/loadFallback.d.ts +1 -1
  42. package/dist/node/plugins/manifest.d.ts +2 -2
  43. package/dist/node/plugins/modulePreloadPolyfill.d.ts +2 -2
  44. package/dist/node/plugins/preAlias.d.ts +1 -1
  45. package/dist/node/plugins/reporter.d.ts +2 -2
  46. package/dist/node/plugins/resolve.d.ts +4 -4
  47. package/dist/node/plugins/ssrRequireHook.d.ts +2 -2
  48. package/dist/node/plugins/terser.d.ts +2 -2
  49. package/dist/node/plugins/wasm.d.ts +2 -2
  50. package/dist/node/plugins/worker.d.ts +2 -2
  51. package/dist/node/preview.d.ts +4 -4
  52. package/dist/node/server/hmr.d.ts +3 -3
  53. package/dist/node/server/index.d.ts +15 -14
  54. package/dist/node/server/middlewares/base.d.ts +2 -2
  55. package/dist/node/server/middlewares/error.d.ts +4 -4
  56. package/dist/node/server/middlewares/indexHtml.d.ts +2 -2
  57. package/dist/node/server/middlewares/proxy.d.ts +4 -4
  58. package/dist/node/server/middlewares/spaFallback.d.ts +1 -1
  59. package/dist/node/server/middlewares/static.d.ts +2 -2
  60. package/dist/node/server/middlewares/time.d.ts +1 -1
  61. package/dist/node/server/middlewares/transform.d.ts +2 -2
  62. package/dist/node/server/moduleGraph.d.ts +2 -2
  63. package/dist/node/server/openBrowser.d.ts +1 -1
  64. package/dist/node/server/pluginContainer.d.ts +5 -5
  65. package/dist/node/server/send.d.ts +2 -2
  66. package/dist/node/server/sourcemap.d.ts +1 -1
  67. package/dist/node/server/transformRequest.d.ts +2 -2
  68. package/dist/node/server/ws.d.ts +5 -5
  69. package/dist/node/ssr/ssrExternal.d.ts +1 -1
  70. package/dist/node/ssr/ssrManifestPlugin.d.ts +2 -2
  71. package/dist/node/ssr/ssrModuleLoader.d.ts +1 -1
  72. package/dist/node/ssr/ssrStacktrace.d.ts +1 -1
  73. package/dist/node/ssr/ssrTransform.d.ts +2 -2
  74. package/dist/node/utils.d.ts +2 -2
  75. package/package.json +13 -13
  76. package/src/client/client.ts +3 -3
  77. package/src/client/overlay.ts +1 -1
  78. package/types/alias.d.ts +1 -1
  79. package/types/chokidar.d.ts +2 -2
  80. package/types/http-proxy.d.ts +4 -4
  81. package/types/importMeta.d.ts +6 -0
  82. package/types/shims.d.ts +5 -5
  83. package/types/ws.d.ts +6 -6
  84. package/dist/node/chunks/dep-5496817b.js.map +0 -1
  85. package/dist/node/chunks/dep-58399509.js.map +0 -1
  86. package/dist/node/chunks/dep-66abeb03.js.map +0 -1
  87. package/dist/node/chunks/dep-cf2decec.js.map +0 -1
@@ -1,8 +1,8 @@
1
- import { Plugin } from '../plugin';
2
- import { ViteDevServer } from '../server';
3
- import { OutputBundle, OutputChunk } from 'rollup';
4
- import { ResolvedConfig } from '../config';
5
- import { AttributeNode, NodeTransform, ElementNode } from '@vue/compiler-dom';
1
+ import type { Plugin } from '../plugin';
2
+ import type { ViteDevServer } from '../server';
3
+ import type { OutputBundle, OutputChunk } from 'rollup';
4
+ import type { ResolvedConfig } from '../config';
5
+ import type { AttributeNode, NodeTransform, ElementNode } from '@vue/compiler-dom';
6
6
  export declare const isHTMLProxy: (id: string) => boolean;
7
7
  export declare const htmlProxyMap: WeakMap<Readonly<Omit<import("../config").UserConfig, "plugins" | "alias" | "dedupe" | "assetsInclude" | "optimizeDeps"> & {
8
8
  configFile: string | undefined;
@@ -1,5 +1,5 @@
1
- import { Plugin } from '../plugin';
2
- import { ResolvedConfig } from '../config';
1
+ import type { Plugin } from '../plugin';
2
+ import type { ResolvedConfig } from '../config';
3
3
  /**
4
4
  * Server-only plugin that lexes, resolves, rewrites and analyzes url imports.
5
5
  *
@@ -1,5 +1,5 @@
1
- import { ResolvedConfig } from '../config';
2
- import { Plugin } from '../plugin';
1
+ import type { ResolvedConfig } from '../config';
2
+ import type { Plugin } from '../plugin';
3
3
  /**
4
4
  * A flag for injected helpers. This flag will be set to `false` if the output
5
5
  * target is not native es - so that injected helper logic can be conditionally
@@ -1,3 +1,3 @@
1
- import { ResolvedConfig } from '../config';
2
- import { Plugin } from '../plugin';
1
+ import type { ResolvedConfig } from '../config';
2
+ import type { Plugin } from '../plugin';
3
3
  export declare function resolvePlugins(config: ResolvedConfig, prePlugins: Plugin[], normalPlugins: Plugin[], postPlugins: Plugin[]): Promise<Plugin[]>;
@@ -5,7 +5,7 @@
5
5
  * LICENSE file at
6
6
  * https://github.com/rollup/plugins/blob/master/LICENSE
7
7
  */
8
- import { Plugin } from 'rollup';
8
+ import type { Plugin } from 'rollup';
9
9
  export interface JsonOptions {
10
10
  /**
11
11
  * Generate a named export for every property of the JSON object
@@ -1,4 +1,4 @@
1
- import { Plugin } from '..';
1
+ import type { Plugin } from '..';
2
2
  /**
3
3
  * A plugin to provide build load fallback for arbitrary request with queries.
4
4
  */
@@ -1,5 +1,5 @@
1
- import { ResolvedConfig } from '..';
2
- import { Plugin } from '../plugin';
1
+ import type { ResolvedConfig } from '..';
2
+ import type { Plugin } from '../plugin';
3
3
  export declare type Manifest = Record<string, ManifestChunk>;
4
4
  export interface ManifestChunk {
5
5
  src?: string;
@@ -1,4 +1,4 @@
1
- import { ResolvedConfig } from '..';
2
- import { Plugin } from '../plugin';
1
+ import type { ResolvedConfig } from '..';
2
+ import type { Plugin } from '../plugin';
3
3
  export declare const modulePreloadPolyfillId = "vite/modulepreload-polyfill";
4
4
  export declare function modulePreloadPolyfillPlugin(config: ResolvedConfig): Plugin;
@@ -1,4 +1,4 @@
1
- import { Plugin } from '../plugin';
1
+ import type { Plugin } from '../plugin';
2
2
  /**
3
3
  * A plugin to avoid an aliased AND optimized dep from being aliased in src
4
4
  */
@@ -1,3 +1,3 @@
1
- import { Plugin } from 'rollup';
2
- import { ResolvedConfig } from '../config';
1
+ import type { Plugin } from 'rollup';
2
+ import type { ResolvedConfig } from '../config';
3
3
  export declare function buildReporterPlugin(config: ResolvedConfig): Plugin;
@@ -1,7 +1,7 @@
1
- import { Plugin } from '../plugin';
2
- import { ViteDevServer, SSROptions } from '..';
3
- import { PartialResolvedId } from 'rollup';
4
- import { PackageCache, PackageData } from '../packages';
1
+ import type { Plugin } from '../plugin';
2
+ import type { ViteDevServer, SSROptions } from '..';
3
+ import type { PartialResolvedId } from 'rollup';
4
+ import type { PackageCache, PackageData } from '../packages';
5
5
  export declare const browserExternalId = "__vite-browser-external";
6
6
  export interface ResolveOptions {
7
7
  mainFields?: string[];
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
- import { ResolvedConfig } from '..';
3
- import { Plugin } from '../plugin';
2
+ import type { ResolvedConfig } from '..';
3
+ import type { Plugin } from '../plugin';
4
4
  /**
5
5
  * This plugin hooks into Node's module resolution algorithm at runtime,
6
6
  * so that SSR builds can benefit from `resolve.dedupe` like they do
@@ -1,3 +1,3 @@
1
- import { Plugin } from '../plugin';
2
- import { ResolvedConfig } from '..';
1
+ import type { Plugin } from '../plugin';
2
+ import type { ResolvedConfig } from '..';
3
3
  export declare function terserPlugin(config: ResolvedConfig): Plugin;
@@ -1,3 +1,3 @@
1
- import { ResolvedConfig } from '../config';
2
- import { Plugin } from '../plugin';
1
+ import type { ResolvedConfig } from '../config';
2
+ import type { Plugin } from '../plugin';
3
3
  export declare const wasmPlugin: (config: ResolvedConfig) => Plugin;
@@ -1,3 +1,3 @@
1
- import { ResolvedConfig } from '../config';
2
- import { Plugin } from '../plugin';
1
+ import type { ResolvedConfig } from '../config';
2
+ import type { Plugin } from '../plugin';
3
3
  export declare function webWorkerPlugin(config: ResolvedConfig): Plugin;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="node" />
2
- import { Server } from 'http';
3
- import { InlineConfig, ResolvedConfig } from '.';
4
- import { ResolvedServerOptions } from './server';
5
- import { CommonServerOptions } from './http';
2
+ import type { Server } from 'http';
3
+ import type { InlineConfig, ResolvedConfig } from '.';
4
+ import type { ResolvedServerOptions } from './server';
5
+ import type { CommonServerOptions } from './http';
6
6
  export interface PreviewOptions extends CommonServerOptions {
7
7
  }
8
8
  export interface ResolvedPreviewOptions extends PreviewOptions {
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
- import { ViteDevServer } from '..';
3
- import { ModuleNode } from './moduleGraph';
4
- import { Server } from 'http';
2
+ import type { ViteDevServer } from '..';
3
+ import type { ModuleNode } from './moduleGraph';
4
+ import type { Server } from 'http';
5
5
  export declare const debugHmr: (...args: any[]) => any;
6
6
  export interface HmrOptions {
7
7
  protocol?: string;
@@ -1,18 +1,19 @@
1
1
  /// <reference types="node" />
2
- import * as http from 'http';
3
- import { CommonServerOptions } from '../http';
4
- import { InlineConfig, ResolvedConfig } from '../config';
5
- import { PluginContainer } from './pluginContainer';
6
- import { FSWatcher, WatchOptions } from 'types/chokidar';
7
- import { WebSocketServer } from './ws';
8
- import { ModuleGraph, ModuleNode } from './moduleGraph';
9
- import { Connect } from 'types/connect';
10
- import { HmrOptions } from './hmr';
11
- import { TransformOptions, TransformResult } from './transformRequest';
12
- import { ESBuildTransformResult } from '../plugins/esbuild';
13
- import { TransformOptions as EsbuildTransformOptions } from 'esbuild';
14
- import { DepOptimizationMetadata } from '../optimizer';
15
- import { SourceMap } from 'rollup';
2
+ import type * as http from 'http';
3
+ import type { CommonServerOptions } from '../http';
4
+ import type { InlineConfig, ResolvedConfig } from '../config';
5
+ import type { PluginContainer } from './pluginContainer';
6
+ import type { FSWatcher, WatchOptions } from 'types/chokidar';
7
+ import type { WebSocketServer } from './ws';
8
+ import type { ModuleNode } from './moduleGraph';
9
+ import { ModuleGraph } from './moduleGraph';
10
+ import type { Connect } from 'types/connect';
11
+ import type { HmrOptions } from './hmr';
12
+ import type { TransformOptions, TransformResult } from './transformRequest';
13
+ import type { ESBuildTransformResult } from '../plugins/esbuild';
14
+ import type { TransformOptions as EsbuildTransformOptions } from 'esbuild';
15
+ import type { DepOptimizationMetadata } from '../optimizer';
16
+ import type { SourceMap } from 'rollup';
16
17
  export { searchForWorkspaceRoot } from './searchRoot';
17
18
  export interface ServerOptions extends CommonServerOptions {
18
19
  /**
@@ -1,3 +1,3 @@
1
- import { ViteDevServer } from '..';
2
- import { Connect } from 'types/connect';
1
+ import type { ViteDevServer } from '..';
2
+ import type { Connect } from 'types/connect';
3
3
  export declare function baseMiddleware({ config }: ViteDevServer): Connect.NextHandleFunction;
@@ -1,7 +1,7 @@
1
- import { RollupError } from 'rollup';
2
- import { ViteDevServer } from '../..';
3
- import { Connect } from 'types/connect';
4
- import { ErrorPayload } from 'types/hmrPayload';
1
+ import type { RollupError } from 'rollup';
2
+ import type { ViteDevServer } from '../..';
3
+ import type { Connect } from 'types/connect';
4
+ import type { ErrorPayload } from 'types/hmrPayload';
5
5
  export declare function prepareError(err: Error | RollupError): ErrorPayload['err'];
6
6
  export declare function buildErrorMessage(err: RollupError, args?: string[], includeStack?: boolean): string;
7
7
  export declare function logError(server: ViteDevServer, err: RollupError): void;
@@ -1,4 +1,4 @@
1
- import { Connect } from 'types/connect';
2
- import { ViteDevServer } from '../..';
1
+ import type { Connect } from 'types/connect';
2
+ import type { ViteDevServer } from '../..';
3
3
  export declare function createDevHtmlTransformFn(server: ViteDevServer): (url: string, html: string, originalUrl: string) => Promise<string>;
4
4
  export declare function indexHtmlMiddleware(server: ViteDevServer): Connect.NextHandleFunction;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="node" />
2
- import * as http from 'http';
3
- import { Connect } from 'types/connect';
4
- import { HttpProxy } from 'types/http-proxy';
5
- import { ResolvedConfig } from '../..';
2
+ import type * as http from 'http';
3
+ import type { Connect } from 'types/connect';
4
+ import type { HttpProxy } from 'types/http-proxy';
5
+ import type { ResolvedConfig } from '../..';
6
6
  export interface ProxyOptions extends HttpProxy.ServerOptions {
7
7
  /**
8
8
  * rewrite path
@@ -1,2 +1,2 @@
1
- import { Connect } from 'types/connect';
1
+ import type { Connect } from 'types/connect';
2
2
  export declare function spaFallbackMiddleware(root: string): Connect.NextHandleFunction;
@@ -1,5 +1,5 @@
1
- import { Connect } from 'types/connect';
2
- import { ViteDevServer } from '../..';
1
+ import type { Connect } from 'types/connect';
2
+ import type { ViteDevServer } from '../..';
3
3
  export declare function servePublicMiddleware(dir: string): Connect.NextHandleFunction;
4
4
  export declare function serveStaticMiddleware(dir: string, server: ViteDevServer): Connect.NextHandleFunction;
5
5
  export declare function serveRawFsMiddleware(server: ViteDevServer): Connect.NextHandleFunction;
@@ -1,2 +1,2 @@
1
- import { Connect } from 'types/connect';
1
+ import type { Connect } from 'types/connect';
2
2
  export declare function timeMiddleware(root: string): Connect.NextHandleFunction;
@@ -1,3 +1,3 @@
1
- import { ViteDevServer } from '..';
2
- import { Connect } from 'types/connect';
1
+ import type { ViteDevServer } from '..';
2
+ import type { Connect } from 'types/connect';
3
3
  export declare function transformMiddleware(server: ViteDevServer): Connect.NextHandleFunction;
@@ -1,5 +1,5 @@
1
- import { ModuleInfo, PartialResolvedId } from 'rollup';
2
- import { TransformResult } from './transformRequest';
1
+ import type { ModuleInfo, PartialResolvedId } from 'rollup';
2
+ import type { TransformResult } from './transformRequest';
3
3
  export declare class ModuleNode {
4
4
  /**
5
5
  * Public served url path, starts with /
@@ -7,7 +7,7 @@
7
7
  * https://github.com/facebook/create-react-app/blob/master/LICENSE
8
8
  *
9
9
  */
10
- import { Logger } from '../logger';
10
+ import type { Logger } from '../logger';
11
11
  /**
12
12
  * Reads the BROWSER environment variable and decides what to do with it.
13
13
  * Returns true if it opened a browser or ran a node.js script, otherwise false.
@@ -2,12 +2,12 @@
2
2
  * This file is refactored into TypeScript based on
3
3
  * https://github.com/preactjs/wmr/blob/main/packages/wmr/src/lib/rollup-plugin-container.js
4
4
  */
5
- import { Plugin } from '../plugin';
6
- import { InputOptions, OutputOptions, ModuleInfo, PartialResolvedId, LoadResult, SourceDescription } from 'rollup';
5
+ import type { Plugin } from '../plugin';
6
+ import type { InputOptions, OutputOptions, ModuleInfo, PartialResolvedId, LoadResult, SourceDescription } from 'rollup';
7
7
  import * as acorn from 'acorn';
8
- import { FSWatcher } from 'chokidar';
9
- import { ResolvedConfig } from '../config';
10
- import { ModuleGraph } from './moduleGraph';
8
+ import type { FSWatcher } from 'chokidar';
9
+ import type { ResolvedConfig } from '../config';
10
+ import type { ModuleGraph } from './moduleGraph';
11
11
  export interface PluginContainerOptions {
12
12
  cwd?: string;
13
13
  output?: OutputOptions;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="node" />
2
- import { IncomingMessage, ServerResponse } from 'http';
3
- import { SourceMap } from 'rollup';
2
+ import type { IncomingMessage, ServerResponse } from 'http';
3
+ import type { SourceMap } from 'rollup';
4
4
  export declare function send(req: IncomingMessage, res: ServerResponse, content: string | Buffer, type: string, etag?: string, cacheControl?: string, map?: SourceMap | null): void;
@@ -1,4 +1,4 @@
1
- import { Logger } from '../logger';
1
+ import type { Logger } from '../logger';
2
2
  interface SourceMapLike {
3
3
  sources: string[];
4
4
  sourcesContent?: (string | null)[];
@@ -1,5 +1,5 @@
1
- import { SourceMap } from 'rollup';
2
- import { ViteDevServer } from '..';
1
+ import type { SourceMap } from 'rollup';
2
+ import type { ViteDevServer } from '..';
3
3
  export interface TransformResult {
4
4
  code: string;
5
5
  map: SourceMap | null;
@@ -1,9 +1,9 @@
1
1
  /// <reference types="node" />
2
- import { Server } from 'http';
3
- import { ServerOptions as HttpsServerOptions } from 'https';
4
- import { WebSocket as WebSocketTypes } from 'types/ws';
5
- import { HMRPayload } from 'types/hmrPayload';
6
- import { ResolvedConfig } from '..';
2
+ import type { Server } from 'http';
3
+ import type { ServerOptions as HttpsServerOptions } from 'https';
4
+ import type { WebSocket as WebSocketTypes } from 'types/ws';
5
+ import type { HMRPayload } from 'types/hmrPayload';
6
+ import type { ResolvedConfig } from '..';
7
7
  export declare const HMR_HEADER = "vite-hmr";
8
8
  export interface WebSocketServer {
9
9
  on: WebSocketTypes.Server['on'];
@@ -1,4 +1,4 @@
1
- import { ResolvedConfig } from '..';
1
+ import type { ResolvedConfig } from '..';
2
2
  /**
3
3
  * Heuristics for determining whether a dependency should be externalized for
4
4
  * server-side rendering.
@@ -1,3 +1,3 @@
1
- import { ResolvedConfig } from '..';
2
- import { Plugin } from '../plugin';
1
+ import type { ResolvedConfig } from '..';
2
+ import type { Plugin } from '../plugin';
3
3
  export declare function ssrManifestPlugin(config: ResolvedConfig): Plugin;
@@ -1,4 +1,4 @@
1
- import { ViteDevServer } from '../server';
1
+ import type { ViteDevServer } from '../server';
2
2
  interface SSRContext {
3
3
  global: typeof globalThis;
4
4
  }
@@ -1,3 +1,3 @@
1
- import { ModuleGraph } from '../server/moduleGraph';
1
+ import type { ModuleGraph } from '../server/moduleGraph';
2
2
  export declare function ssrRewriteStacktrace(stack: string, moduleGraph: ModuleGraph): string;
3
3
  export declare function rebindErrorStacktrace(e: Error, stacktrace: string): void;
@@ -1,5 +1,5 @@
1
- import { SourceMap } from 'rollup';
2
- import { TransformResult } from '../server/transformRequest';
1
+ import type { SourceMap } from 'rollup';
2
+ import type { TransformResult } from '../server/transformRequest';
3
3
  export declare const ssrModuleExportsKey = "__vite_ssr_exports__";
4
4
  export declare const ssrImportKey = "__vite_ssr_import__";
5
5
  export declare const ssrDynamicImportKey = "__vite_ssr_dynamic_import__";
@@ -1,6 +1,6 @@
1
1
  import debug from 'debug';
2
- import { FSWatcher } from 'chokidar';
3
- import { DecodedSourceMap, RawSourceMap } from '@ampproject/remapping/dist/types/types';
2
+ import type { FSWatcher } from 'chokidar';
3
+ import type { DecodedSourceMap, RawSourceMap } from '@ampproject/remapping/dist/types/types';
4
4
  export declare function slash(p: string): string;
5
5
  export declare function unwrapId(id: string): string;
6
6
  export declare const flattenId: (id: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "2.7.3",
3
+ "version": "2.7.7",
4
4
  "license": "MIT",
5
5
  "author": "Evan You",
6
6
  "description": "Native-ESM powered web dev build tool",
@@ -35,17 +35,17 @@
35
35
  "build-types": "run-s build-temp-types patch-types roll-types",
36
36
  "build-temp-types": "tsc --emitDeclarationOnly --outDir temp/node -p src/node",
37
37
  "ci-build": "rimraf dist && run-s build-bundle build-types",
38
- "patch-types": "node scripts/patchTypes.cjs",
38
+ "patch-types": "ts-node scripts/patchTypes.ts",
39
39
  "roll-types": "api-extractor run && rimraf temp",
40
40
  "lint": "eslint --ext .ts src/**",
41
41
  "format": "prettier --write --parser typescript \"src/**/*.ts\"",
42
42
  "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path .",
43
- "release": "node ../../scripts/release.cjs"
43
+ "release": "ts-node ../../scripts/release.ts"
44
44
  },
45
45
  "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
46
46
  "dependencies": {
47
47
  "esbuild": "^0.13.12",
48
- "postcss": "^8.3.11",
48
+ "postcss": "^8.4.5",
49
49
  "resolve": "^1.20.0",
50
50
  "rollup": "^2.59.0"
51
51
  },
@@ -53,16 +53,16 @@
53
53
  "fsevents": "~2.3.2"
54
54
  },
55
55
  "devDependencies": {
56
- "@ampproject/remapping": "^1.0.1",
57
- "@babel/parser": "^7.16.4",
56
+ "@ampproject/remapping": "^1.0.2",
57
+ "@babel/parser": "^7.16.6",
58
58
  "@babel/types": "^7.16.0",
59
59
  "@rollup/plugin-alias": "^3.1.8",
60
60
  "@rollup/plugin-commonjs": "^21.0.1",
61
61
  "@rollup/plugin-dynamic-import-vars": "^1.4.1",
62
62
  "@rollup/plugin-json": "^4.1.0",
63
- "@rollup/plugin-node-resolve": "13.0.6",
63
+ "@rollup/plugin-node-resolve": "13.1.1",
64
64
  "@rollup/plugin-typescript": "^8.3.0",
65
- "@rollup/pluginutils": "^4.1.1",
65
+ "@rollup/pluginutils": "^4.1.2",
66
66
  "@types/convert-source-map": "^1.5.2",
67
67
  "@types/debug": "^4.1.7",
68
68
  "@types/estree": "^0.0.50",
@@ -70,12 +70,12 @@
70
70
  "@types/less": "^3.0.3",
71
71
  "@types/micromatch": "^4.0.2",
72
72
  "@types/mime": "^2.0.3",
73
- "@types/node": "^16.11.9",
73
+ "@types/node": "^16.11.14",
74
74
  "@types/resolve": "^1.20.1",
75
- "@types/sass": "~1.43.0",
75
+ "@types/sass": "~1.43.1",
76
76
  "@types/stylus": "^0.48.36",
77
77
  "@types/ws": "^8.2.2",
78
- "@vue/compiler-dom": "^3.2.22",
78
+ "@vue/compiler-dom": "^3.2.26",
79
79
  "acorn": "^8.6.0",
80
80
  "acorn-class-fields": "^1.0.0",
81
81
  "acorn-static-class-features": "^1.0.0",
@@ -87,7 +87,7 @@
87
87
  "connect-history-api-fallback": "^1.6.0",
88
88
  "convert-source-map": "^1.8.0",
89
89
  "cors": "^2.8.5",
90
- "debug": "^4.3.2",
90
+ "debug": "^4.3.3",
91
91
  "dotenv": "^10.0.0",
92
92
  "dotenv-expand": "^5.1.0",
93
93
  "es-module-lexer": "^0.9.3",
@@ -109,7 +109,7 @@
109
109
  "resolve.exports": "^1.1.0",
110
110
  "rollup-plugin-license": "^2.6.0",
111
111
  "selfsigned": "^1.10.11",
112
- "sirv": "^1.0.18",
112
+ "sirv": "^1.0.19",
113
113
  "source-map": "^0.6.1",
114
114
  "source-map-support": "^0.5.21",
115
115
  "strip-ansi": "^6.0.1",
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  ErrorPayload,
3
3
  FullReloadPayload,
4
4
  HMRPayload,
@@ -6,7 +6,7 @@ import {
6
6
  Update,
7
7
  UpdatePayload
8
8
  } from 'types/hmrPayload'
9
- import { CustomEventName } from 'types/customEvent'
9
+ import type { CustomEventName } from 'types/customEvent'
10
10
  import { ErrorOverlay, overlayId } from './overlay'
11
11
  // eslint-disable-next-line node/no-missing-import
12
12
  import '@vite/env'
@@ -100,7 +100,7 @@ async function handleMessage(payload: HMRPayload) {
100
100
  if (payload.path && payload.path.endsWith('.html')) {
101
101
  // if html file is edited, only reload the page if the browser is
102
102
  // currently on that page.
103
- const pagePath = location.pathname
103
+ const pagePath = decodeURI(location.pathname)
104
104
  const payloadPath = base + payload.path.slice(1)
105
105
  if (
106
106
  pagePath === payloadPath ||
@@ -1,4 +1,4 @@
1
- import { ErrorPayload } from 'types/hmrPayload'
1
+ import type { ErrorPayload } from 'types/hmrPayload'
2
2
 
3
3
  const template = /*html*/ `
4
4
  <style>
package/types/alias.d.ts CHANGED
@@ -27,7 +27,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
27
  THE SOFTWARE.
28
28
  */
29
29
 
30
- import { PluginHooks } from 'rollup'
30
+ import type { PluginHooks } from 'rollup'
31
31
 
32
32
  export interface Alias {
33
33
  find: string | RegExp
@@ -28,8 +28,8 @@ THE SOFTWARE.
28
28
  */
29
29
  /// <reference types="node" />
30
30
 
31
- import * as fs from 'fs'
32
- import { Matcher } from './anymatch'
31
+ import type * as fs from 'fs'
32
+ import type { Matcher } from './anymatch'
33
33
 
34
34
  export interface FSWatcher extends fs.FSWatcher {
35
35
  options: WatchOptions
@@ -13,11 +13,11 @@
13
13
 
14
14
  /// <reference types="node" />
15
15
 
16
- import * as net from 'net'
17
- import * as http from 'http'
16
+ import type * as net from 'net'
17
+ import type * as http from 'http'
18
18
  import * as events from 'events'
19
- import * as url from 'url'
20
- import * as stream from 'stream'
19
+ import type * as url from 'url'
20
+ import type * as stream from 'stream'
21
21
 
22
22
  export namespace HttpProxy {
23
23
  export type ProxyTarget = ProxyTargetUrl | ProxyTargetDetailed
@@ -1,3 +1,9 @@
1
+ // This file is an augmentation to the built-in ImportMeta interface
2
+ // Thus cannot contain any top-level imports
3
+ // <https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation>
4
+
5
+ /* eslint-disable @typescript-eslint/consistent-type-imports */
6
+
1
7
  interface ImportMeta {
2
8
  url: string
3
9
 
package/types/shims.d.ts CHANGED
@@ -38,7 +38,7 @@ declare module 'launch-editor-middleware' {
38
38
  }
39
39
 
40
40
  declare module 'postcss-load-config' {
41
- import { ProcessOptions, Plugin } from 'postcss'
41
+ import type { ProcessOptions, Plugin } from 'postcss'
42
42
  function load(
43
43
  inline: any,
44
44
  root: string
@@ -50,7 +50,7 @@ declare module 'postcss-load-config' {
50
50
  }
51
51
 
52
52
  declare module 'postcss-import' {
53
- import { Plugin } from 'postcss'
53
+ import type { Plugin } from 'postcss'
54
54
  const plugin: (options: {
55
55
  resolve: (
56
56
  id: string,
@@ -62,13 +62,13 @@ declare module 'postcss-import' {
62
62
  }
63
63
 
64
64
  declare module 'postcss-modules' {
65
- import { Plugin } from 'postcss'
65
+ import type { Plugin } from 'postcss'
66
66
  const plugin: (options: any) => Plugin
67
67
  export = plugin
68
68
  }
69
69
 
70
70
  declare module '@rollup/plugin-dynamic-import-vars' {
71
- import { Plugin } from 'rollup'
71
+ import type { Plugin } from 'rollup'
72
72
 
73
73
  interface Options {
74
74
  include?: string | RegExp | (string | RegExp)[]
@@ -81,7 +81,7 @@ declare module '@rollup/plugin-dynamic-import-vars' {
81
81
  }
82
82
 
83
83
  declare module 'rollup-plugin-web-worker-loader' {
84
- import { Plugin } from 'rollup'
84
+ import type { Plugin } from 'rollup'
85
85
 
86
86
  interface Options {
87
87
  targetPlatform?: string