vite 2.7.4 → 2.7.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.

Potentially problematic release.


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

package/dist/node/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var require$$0 = require('events');
4
- var build = require('./chunks/dep-cb6d7f22.js');
4
+ var build = require('./chunks/dep-24a6b4c4.js');
5
5
  var perf_hooks = require('perf_hooks');
6
6
  require('fs');
7
7
  require('path');
@@ -683,7 +683,7 @@ cli
683
683
  .action(async (root, options) => {
684
684
  // output structure is preserved even after bundling so require()
685
685
  // is ok here
686
- const { createServer } = await Promise.resolve().then(function () { return require('./chunks/dep-cb6d7f22.js'); }).then(function (n) { return n.index$1; });
686
+ const { createServer } = await Promise.resolve().then(function () { return require('./chunks/dep-24a6b4c4.js'); }).then(function (n) { return n.index$1; });
687
687
  try {
688
688
  const server = await createServer({
689
689
  root,
@@ -732,7 +732,7 @@ cli
732
732
  .option('--emptyOutDir', `[boolean] force empty outDir when it's outside of root`)
733
733
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
734
734
  .action(async (root, options) => {
735
- const { build: build$1 } = await Promise.resolve().then(function () { return require('./chunks/dep-cb6d7f22.js'); }).then(function (n) { return n.build$1; });
735
+ const { build: build$1 } = await Promise.resolve().then(function () { return require('./chunks/dep-24a6b4c4.js'); }).then(function (n) { return n.build$1; });
736
736
  const buildOptions = cleanOptions(options);
737
737
  try {
738
738
  await build$1({
@@ -755,7 +755,7 @@ cli
755
755
  .command('optimize [root]')
756
756
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
757
757
  .action(async (root, options) => {
758
- const { optimizeDeps } = await Promise.resolve().then(function () { return require('./chunks/dep-cb6d7f22.js'); }).then(function (n) { return n.index; });
758
+ const { optimizeDeps } = await Promise.resolve().then(function () { return require('./chunks/dep-24a6b4c4.js'); }).then(function (n) { return n.index; });
759
759
  try {
760
760
  const config = await build.resolveConfig({
761
761
  root,
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var build = require('./chunks/dep-cb6d7f22.js');
5
+ var build = require('./chunks/dep-24a6b4c4.js');
6
6
  require('fs');
7
7
  require('path');
8
8
  require('os');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "2.7.4",
3
+ "version": "2.7.8",
4
4
  "license": "MIT",
5
5
  "author": "Evan You",
6
6
  "description": "Native-ESM powered web dev build tool",
@@ -76,9 +76,7 @@
76
76
  "@types/stylus": "^0.48.36",
77
77
  "@types/ws": "^8.2.2",
78
78
  "@vue/compiler-dom": "^3.2.26",
79
- "acorn": "^8.6.0",
80
- "acorn-class-fields": "^1.0.0",
81
- "acorn-static-class-features": "^1.0.0",
79
+ "acorn": "^8.7.0",
82
80
  "cac": "6.7.9",
83
81
  "chalk": "^4.1.2",
84
82
  "chokidar": "^3.5.2",
@@ -96,7 +94,7 @@
96
94
  "execa": "^5.1.1",
97
95
  "fast-glob": "^3.2.7",
98
96
  "http-proxy": "^1.18.1",
99
- "launch-editor-middleware": "^2.2.1",
97
+ "launch-editor-middleware": "^2.3.0",
100
98
  "magic-string": "^0.25.7",
101
99
  "micromatch": "^4.0.4",
102
100
  "mime": "^3.0.0",
@@ -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 ||
@@ -485,3 +485,5 @@ export function injectQuery(url: string, queryToInject: string): string {
485
485
  hash || ''
486
486
  }`
487
487
  }
488
+
489
+ export { ErrorOverlay }
@@ -1,10 +1,8 @@
1
- import type { CustomEventName } from './customEvent'
2
- import type {
3
- ErrorPayload,
4
- FullReloadPayload,
5
- PrunePayload,
6
- UpdatePayload
7
- } from './hmrPayload'
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 */
8
6
 
9
7
  interface ImportMeta {
10
8
  url: string
@@ -27,15 +25,24 @@ interface ImportMeta {
27
25
  invalidate(): void
28
26
 
29
27
  on: {
30
- (event: 'vite:beforeUpdate', cb: (payload: UpdatePayload) => void): void
31
- (event: 'vite:beforePrune', cb: (payload: PrunePayload) => void): void
28
+ (
29
+ event: 'vite:beforeUpdate',
30
+ cb: (payload: import('./hmrPayload').UpdatePayload) => void
31
+ ): void
32
+ (
33
+ event: 'vite:beforePrune',
34
+ cb: (payload: import('./hmrPayload').PrunePayload) => void
35
+ ): void
32
36
  (
33
37
  event: 'vite:beforeFullReload',
34
- cb: (payload: FullReloadPayload) => void
38
+ cb: (payload: import('./hmrPayload').FullReloadPayload) => void
39
+ ): void
40
+ (
41
+ event: 'vite:error',
42
+ cb: (payload: import('./hmrPayload').ErrorPayload) => void
35
43
  ): void
36
- (event: 'vite:error', cb: (payload: ErrorPayload) => void): void
37
44
  <T extends string>(
38
- event: CustomEventName<T>,
45
+ event: import('./customEvent').CustomEventName<T>,
39
46
  cb: (data: any) => void
40
47
  ): void
41
48
  }
package/types/shims.d.ts CHANGED
@@ -17,16 +17,6 @@ declare module 'http-proxy' {
17
17
  export = proxy
18
18
  }
19
19
 
20
- declare module 'acorn-class-fields' {
21
- const plugin: any
22
- export = plugin
23
- }
24
-
25
- declare module 'acorn-static-class-features' {
26
- const plugin: any
27
- export default plugin
28
- }
29
-
30
20
  declare module 'connect-history-api-fallback' {
31
21
  const plugin: any
32
22
  export = plugin