vite 2.6.14 → 2.7.0-beta.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "2.6.14",
3
+ "version": "2.7.0-beta.11",
4
4
  "license": "MIT",
5
5
  "author": "Evan You",
6
6
  "description": "Native-ESM powered web dev build tool",
@@ -35,52 +35,51 @@
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",
38
+ "patch-types": "node scripts/patchTypes.cjs",
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.js"
43
+ "release": "node ../../scripts/release.cjs"
44
44
  },
45
45
  "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
46
46
  "dependencies": {
47
- "esbuild": "^0.13.2",
48
- "postcss": "^8.3.8",
47
+ "esbuild": "^0.13.12",
48
+ "postcss": "^8.3.11",
49
49
  "resolve": "^1.20.0",
50
- "rollup": "^2.57.0"
50
+ "rollup": "^2.59.0"
51
51
  },
52
52
  "optionalDependencies": {
53
53
  "fsevents": "~2.3.2"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@ampproject/remapping": "^1.0.1",
57
- "@babel/parser": "^7.15.8",
58
- "@babel/types": "^7.15.6",
59
- "@rollup/plugin-alias": "^3.1.5",
60
- "@rollup/plugin-commonjs": "^21.0.0",
61
- "@rollup/plugin-dynamic-import-vars": "^1.4.0",
57
+ "@babel/parser": "^7.16.4",
58
+ "@babel/types": "^7.16.0",
59
+ "@rollup/plugin-alias": "^3.1.8",
60
+ "@rollup/plugin-commonjs": "^21.0.1",
61
+ "@rollup/plugin-dynamic-import-vars": "^1.4.1",
62
62
  "@rollup/plugin-json": "^4.1.0",
63
- "@rollup/plugin-node-resolve": "13.0.5",
64
- "@rollup/plugin-typescript": "^8.2.5",
63
+ "@rollup/plugin-node-resolve": "13.0.6",
64
+ "@rollup/plugin-typescript": "^8.3.0",
65
65
  "@rollup/pluginutils": "^4.1.1",
66
66
  "@types/convert-source-map": "^1.5.2",
67
67
  "@types/debug": "^4.1.7",
68
- "@types/es-module-lexer": "^0.3.0",
69
68
  "@types/estree": "^0.0.50",
70
69
  "@types/etag": "^1.8.1",
71
70
  "@types/less": "^3.0.3",
71
+ "@types/micromatch": "^4.0.2",
72
72
  "@types/mime": "^2.0.3",
73
- "@types/node": "^15.12.2",
73
+ "@types/node": "^16.11.9",
74
74
  "@types/resolve": "^1.20.1",
75
- "@types/sass": "^1.16.1",
75
+ "@types/sass": "~1.43.0",
76
76
  "@types/stylus": "^0.48.36",
77
- "@types/ws": "^7.4.7",
78
- "@vue/compiler-dom": "^3.2.19",
79
- "acorn": "^8.5.0",
77
+ "@types/ws": "^8.2.0",
78
+ "@vue/compiler-dom": "^3.2.22",
79
+ "acorn": "^8.6.0",
80
80
  "acorn-class-fields": "^1.0.0",
81
81
  "acorn-static-class-features": "^1.0.0",
82
- "builtin-modules": "^3.2.0",
83
- "cac": "^6.7.3",
82
+ "cac": "6.7.9",
84
83
  "chalk": "^4.1.2",
85
84
  "chokidar": "^3.5.2",
86
85
  "compression": "^1.7.4",
@@ -91,7 +90,7 @@
91
90
  "debug": "^4.3.2",
92
91
  "dotenv": "^10.0.0",
93
92
  "dotenv-expand": "^5.1.0",
94
- "es-module-lexer": "^0.9.2",
93
+ "es-module-lexer": "^0.9.3",
95
94
  "estree-walker": "^2.0.2",
96
95
  "etag": "^1.8.1",
97
96
  "execa": "^5.1.1",
@@ -99,26 +98,26 @@
99
98
  "http-proxy": "^1.18.1",
100
99
  "launch-editor-middleware": "^2.2.1",
101
100
  "magic-string": "^0.25.7",
102
- "mime": "^2.5.2",
103
- "minimatch": "^3.0.4",
101
+ "micromatch": "^4.0.4",
102
+ "mime": "^3.0.0",
104
103
  "okie": "^1.0.1",
105
- "open": "^8.2.1",
104
+ "open": "^8.4.0",
106
105
  "periscopic": "^2.0.3",
107
106
  "postcss-import": "^14.0.2",
108
107
  "postcss-load-config": "^3.1.0",
109
108
  "postcss-modules": "^4.2.2",
110
- "resolve.exports": "^1.0.2",
111
- "rollup-plugin-license": "^2.5.0",
109
+ "resolve.exports": "^1.1.0",
110
+ "rollup-plugin-license": "^2.6.0",
112
111
  "selfsigned": "^1.10.11",
113
- "sirv": "^1.0.17",
112
+ "sirv": "^1.0.18",
114
113
  "source-map": "^0.6.1",
115
- "source-map-support": "^0.5.20",
116
- "strip-ansi": "^6.0.0",
117
- "terser": "^5.9.0",
118
- "tsconfck": "^1.0.0",
114
+ "source-map-support": "^0.5.21",
115
+ "strip-ansi": "^6.0.1",
116
+ "terser": "^5.10.0",
117
+ "tsconfck": "1.1.1",
119
118
  "tslib": "^2.3.1",
120
119
  "types": "link:./types",
121
- "ws": "^7.5.5"
120
+ "ws": "^8.2.3"
122
121
  },
123
122
  "peerDependencies": {
124
123
  "less": "*",
@@ -78,10 +78,8 @@ async function handleMessage(payload: HMRPayload) {
78
78
  // can't use querySelector with `[href*=]` here since the link may be
79
79
  // using relative paths so we need to use link.href to grab the full
80
80
  // URL for the include check.
81
- const el = (
82
- [].slice.call(
83
- document.querySelectorAll(`link`)
84
- ) as HTMLLinkElement[]
81
+ const el = Array.from(
82
+ document.querySelectorAll<HTMLLinkElement>('link')
85
83
  ).find((e) => e.href.includes(path))
86
84
  if (el) {
87
85
  const newPath = `${base}${path.slice(1)}${
@@ -275,8 +273,6 @@ export function removeStyle(id: string): void {
275
273
  const style = sheetsMap.get(id)
276
274
  if (style) {
277
275
  if (style instanceof CSSStyleSheet) {
278
- // @ts-ignore
279
- const index = document.adoptedStyleSheets.indexOf(style)
280
276
  // @ts-ignore
281
277
  document.adoptedStyleSheets = document.adoptedStyleSheets.filter(
282
278
  (s: CSSStyleSheet) => s !== style
@@ -7,7 +7,7 @@
7
7
  */
8
8
  export interface RollupCommonJSOptions {
9
9
  /**
10
- * A minimatch pattern, or array of patterns, which specifies the files in
10
+ * A picomatch pattern, or array of patterns, which specifies the files in
11
11
  * the build the plugin should operate on. By default, all files with
12
12
  * extension `".cjs"` or those in `extensions` are included, but you can narrow
13
13
  * this list by only including specific files. These files will be analyzed
@@ -17,7 +17,7 @@ export interface RollupCommonJSOptions {
17
17
  */
18
18
  include?: string | RegExp | readonly (string | RegExp)[]
19
19
  /**
20
- * A minimatch pattern, or array of patterns, which specifies the files in
20
+ * A picomatch pattern, or array of patterns, which specifies the files in
21
21
  * the build the plugin should _ignore_. By default, all files with
22
22
  * extensions other than those in `extensions` or `".cjs"` are ignored, but you
23
23
  * can exclude additional files. See also the `include` option.
@@ -71,6 +71,26 @@ export interface RollupCommonJSOptions {
71
71
  * @default []
72
72
  */
73
73
  ignore?: ReadonlyArray<string> | ((id: string) => boolean)
74
+ /**
75
+ * In most cases, where `require` calls are inside a `try-catch` clause,
76
+ * they should be left unconverted as it requires an optional dependency
77
+ * that may or may not be installed beside the rolled up package.
78
+ * Due to the conversion of `require` to a static `import` - the call is hoisted
79
+ * to the top of the file, outside of the `try-catch` clause.
80
+ *
81
+ * - `true`: All `require` calls inside a `try` will be left unconverted.
82
+ * - `false`: All `require` calls inside a `try` will be converted as if the `try-catch` clause is not there.
83
+ * - `remove`: Remove all `require` calls from inside any `try` block.
84
+ * - `string[]`: Pass an array containing the IDs to left unconverted.
85
+ * - `((id: string) => boolean|'remove')`: Pass a function that control individual IDs.
86
+ *
87
+ * @default false
88
+ */
89
+ ignoreTryCatch?:
90
+ | boolean
91
+ | 'remove'
92
+ | ReadonlyArray<string>
93
+ | ((id: string) => boolean | 'remove')
74
94
  /**
75
95
  * Controls how to render imports from external dependencies. By default,
76
96
  * this plugin assumes that all external dependencies are CommonJS. This
package/types/shims.d.ts CHANGED
@@ -95,9 +95,12 @@ declare module 'rollup-plugin-web-worker-loader' {
95
95
  export default p
96
96
  }
97
97
 
98
- declare module 'minimatch' {
99
- function match(path: string, pattern: string): boolean
100
- export default match
98
+ declare module 'micromatch' {
99
+ export function isMatch(
100
+ path: string,
101
+ pattern: string,
102
+ options?: { matchBase?: boolean }
103
+ ): boolean
101
104
  }
102
105
 
103
106
  declare module 'compression' {