vite 2.4.0 → 2.4.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.

package/dist/node/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var require$$0$1 = require('events');
4
- var build = require('./chunks/dep-fc2895ac.js');
4
+ var build = require('./chunks/dep-cc49d7be.js');
5
5
  var path = require('path');
6
6
  var require$$0$2 = require('tty');
7
7
  var require$$0$3 = require('util');
@@ -13954,7 +13954,7 @@ cli
13954
13954
  .action(async (root, options) => {
13955
13955
  // output structure is preserved even after bundling so require()
13956
13956
  // is ok here
13957
- const { createServer } = await Promise.resolve().then(function () { return require('./chunks/dep-fc2895ac.js'); }).then(function (n) { return n.index$1; });
13957
+ const { createServer } = await Promise.resolve().then(function () { return require('./chunks/dep-cc49d7be.js'); }).then(function (n) { return n.index$1; });
13958
13958
  try {
13959
13959
  const server = await createServer({
13960
13960
  root,
@@ -13989,7 +13989,7 @@ cli
13989
13989
  .option('-m, --mode <mode>', `[string] set env mode`)
13990
13990
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
13991
13991
  .action(async (root, options) => {
13992
- const { build: build$1 } = await Promise.resolve().then(function () { return require('./chunks/dep-fc2895ac.js'); }).then(function (n) { return n.build$1; });
13992
+ const { build: build$1 } = await Promise.resolve().then(function () { return require('./chunks/dep-cc49d7be.js'); }).then(function (n) { return n.build$1; });
13993
13993
  const buildOptions = cleanOptions(options);
13994
13994
  try {
13995
13995
  await build$1({
@@ -14012,7 +14012,7 @@ cli
14012
14012
  .command('optimize [root]')
14013
14013
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
14014
14014
  .action(async (root, options) => {
14015
- const { optimizeDeps } = await Promise.resolve().then(function () { return require('./chunks/dep-fc2895ac.js'); }).then(function (n) { return n.index; });
14015
+ const { optimizeDeps } = await Promise.resolve().then(function () { return require('./chunks/dep-cc49d7be.js'); }).then(function (n) { return n.index; });
14016
14016
  try {
14017
14017
  const config = await build.resolveConfig({
14018
14018
  root,
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+
2
3
  import { BuildOptions as BuildOptions_2 } from 'esbuild';
3
4
  import { ChangeEvent } from 'rollup';
4
5
  import { CustomPluginOptions } from 'rollup';
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var build = require('./chunks/dep-fc2895ac.js');
5
+ var build = require('./chunks/dep-cc49d7be.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.4.0",
3
+ "version": "2.4.1",
4
4
  "license": "MIT",
5
5
  "author": "Evan You",
6
6
  "description": "Native-ESM powered web dev build tool",
@@ -68,18 +68,18 @@
68
68
  "@rollup/pluginutils": "^4.1.0",
69
69
  "@types/clean-css": "^4.2.4",
70
70
  "@types/convert-source-map": "^1.5.1",
71
- "@types/debug": "^4.1.5",
71
+ "@types/debug": "^4.1.6",
72
72
  "@types/es-module-lexer": "^0.3.0",
73
- "@types/estree": "^0.0.48",
73
+ "@types/estree": "^0.0.49",
74
74
  "@types/etag": "^1.8.0",
75
75
  "@types/less": "^3.0.2",
76
76
  "@types/mime": "^2.0.3",
77
77
  "@types/node": "^15.12.2",
78
78
  "@types/resolve": "^1.20.0",
79
79
  "@types/sass": "^1.16.0",
80
- "@types/stylus": "^0.48.35",
81
- "@types/ws": "^7.4.5",
82
- "@vue/compiler-dom": "^3.1.2",
80
+ "@types/stylus": "^0.48.36",
81
+ "@types/ws": "^7.4.6",
82
+ "@vue/compiler-dom": "^3.1.4",
83
83
  "acorn": "^8.4.1",
84
84
  "acorn-class-fields": "^1.0.0",
85
85
  "acorn-numeric-separator": "^0.3.6",
@@ -109,7 +109,7 @@
109
109
  "mime": "^2.5.2",
110
110
  "minimatch": "^3.0.4",
111
111
  "okie": "^1.0.1",
112
- "open": "^7.4.2",
112
+ "open": "^8.2.1",
113
113
  "periscopic": "^2.0.3",
114
114
  "postcss-import": "^14.0.2",
115
115
  "postcss-load-config": "^3.0.0",
@@ -124,6 +124,6 @@
124
124
  "terser": "^5.7.1",
125
125
  "tslib": "^2.3.0",
126
126
  "types": "link:./types",
127
- "ws": "^7.5.0"
127
+ "ws": "^7.5.2"
128
128
  }
129
129
  }
@@ -361,12 +361,7 @@ function isSingleDefaultExport(exports: string[]) {
361
361
 
362
362
  const lockfileFormats = ['package-lock.json', 'yarn.lock', 'pnpm-lock.yaml']
363
363
 
364
- let cachedHash: string | undefined
365
-
366
364
  function getDepHash(root: string, config: ResolvedConfig): string {
367
- if (cachedHash) {
368
- return cachedHash
369
- }
370
365
  let content = lookupFile(root, lockfileFormats) || ''
371
366
  // also take config into account
372
367
  // only a subset of config options that can affect dep optimization
@@ -81,7 +81,7 @@ export interface CSSModulesOptions {
81
81
  }
82
82
 
83
83
  const cssLangs = `\\.(css|less|sass|scss|styl|stylus|pcss|postcss)($|\\?)`
84
- const cssLangRE = new RegExp(cssLangs)
84
+ export const cssLangRE = new RegExp(cssLangs)
85
85
  const cssModuleRE = new RegExp(`\\.module${cssLangs}`)
86
86
  const directRequestRE = /(\?|&)direct\b/
87
87
  const commonjsProxyRE = /\?commonjs-proxy/
@@ -10,7 +10,7 @@ import { RollupError } from 'rollup'
10
10
  import { prepareError } from './middlewares/error'
11
11
  import match from 'minimatch'
12
12
  import { Server } from 'http'
13
- import { isCSSRequest } from '../plugins/css'
13
+ import { cssLangRE } from '../plugins/css'
14
14
 
15
15
  export const debugHmr = createDebugger('vite:hmr')
16
16
 
@@ -227,7 +227,7 @@ function propagateUpdate(
227
227
  // additionally check for CSS importers, since a PostCSS plugin like
228
228
  // Tailwind JIT may register any file as a dependency to a CSS file.
229
229
  for (const importer of node.importers) {
230
- if (isCSSRequest(importer.url) && !currentChain.includes(importer)) {
230
+ if (cssLangRE.test(importer.url) && !currentChain.includes(importer)) {
231
231
  propagateUpdate(
232
232
  importer,
233
233
  timestamp,
@@ -243,13 +243,13 @@ function propagateUpdate(
243
243
  if (!node.importers.size) {
244
244
  return true
245
245
  }
246
-
246
+
247
247
  // #3716, #3913
248
248
  // For a non-CSS file, if all of its importers are CSS files (registered via
249
249
  // PostCSS plugins) it should be considered a dead end and force full reload.
250
250
  if (
251
- !isCSSRequest(node.url) &&
252
- [...node.importers].every((i) => isCSSRequest(i.url))
251
+ !cssLangRE.test(node.url) &&
252
+ [...node.importers].every((i) => cssLangRE.test(i.url))
253
253
  ) {
254
254
  return true
255
255
  }
@@ -91,7 +91,7 @@ function startBrowserProcess(browser: string | undefined, url: string) {
91
91
  // Fallback to open
92
92
  // (It will always open new tab)
93
93
  try {
94
- const options = { app: browser, url: true }
94
+ const options: open.Options = browser ? { app: { name: browser } } : {}
95
95
  open(url, options).catch(() => {}) // Prevent `unhandledRejection` error.
96
96
  return true
97
97
  } catch (err) {