vite 2.7.0-beta.1 → 2.7.0-beta.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.

@@ -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,13 +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(
98
+ declare module 'micromatch' {
99
+ export function isMatch(
100
100
  path: string,
101
101
  pattern: string,
102
102
  options?: { matchBase?: boolean }
103
103
  ): boolean
104
- export default match
105
104
  }
106
105
 
107
106
  declare module 'compression' {