@rollup/plugin-node-resolve 11.0.1 → 11.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # @rollup/plugin-node-resolve ChangeLog
2
2
 
3
+ ## v11.2.1
4
+
5
+ _2021-03-26_
6
+
7
+ ### Bugfixes
8
+
9
+ - fix: fs.exists is incorrectly promisified (#835)
10
+
11
+ ## v11.2.0
12
+
13
+ _2021-02-14_
14
+
15
+ ### Features
16
+
17
+ - feat: add `ignoreSideEffectsForRoot` option (#694)
18
+
19
+ ### Updates
20
+
21
+ - chore: mark `url` as an external and throw on warning (#783)
22
+ - docs: clearer "Resolving Built-Ins" doc (#782)
23
+
24
+ ## v11.1.1
25
+
26
+ _2021-01-29_
27
+
28
+ ### Bugfixes
29
+
30
+ - fix: only log last resolve error (#750)
31
+
32
+ ### Updates
33
+
34
+ - docs: add clarification on the order of package entrypoints (#768)
35
+
36
+ ## v11.1.0
37
+
38
+ _2021-01-15_
39
+
40
+ ### Features
41
+
42
+ - feat: support pkg imports and export array (#693)
43
+
3
44
  ## v11.0.1
4
45
 
5
46
  _2020-12-14_
package/README.md CHANGED
@@ -42,6 +42,10 @@ export default {
42
42
 
43
43
  Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api).
44
44
 
45
+ ## Package entrypoints
46
+
47
+ This plugin supports the package entrypoints feature from node js, specified in the `exports` or `imports` field of a package. Check the [official documentation](https://nodejs.org/api/packages.html#packages_package_entry_points) for more information on how this works. This is the default behavior. In the abscence of these fields, the fields in `mainFields` will be the ones to be used.
48
+
45
49
  ## Options
46
50
 
47
51
  ### `exportConditions`
@@ -62,6 +66,8 @@ Default: `false`
62
66
 
63
67
  If `true`, instructs the plugin to use the `"browser"` property in `package.json` files to specify alternative files to load for bundling. This is useful when bundling for a browser environment. Alternatively, a value of `'browser'` can be added to the `mainFields` option. If `false`, any `"browser"` properties in package files will be ignored. This option takes precedence over `mainFields`.
64
68
 
69
+ > This option does not work when a package is using [package entrypoints](https://nodejs.org/api/packages.html#packages_package_entry_points)
70
+
65
71
  ### `moduleDirectories`
66
72
 
67
73
  Type: `Array[...String]`<br>
@@ -151,6 +157,10 @@ Specifies the root directory from which to resolve modules. Typically used when
151
157
  rootDir: path.join(process.cwd(), '..')
152
158
  ```
153
159
 
160
+ ## `ignoreSideEffectsForRoot`
161
+
162
+ If you use the `sideEffects` property in the package.json, by default this is respected for files in the root package. Set to `true` to ignore the `sideEffects` configuration for the root package.
163
+
154
164
  ## Preserving symlinks
155
165
 
156
166
  This plugin honours the rollup [`preserveSymlinks`](https://rollupjs.org/guide/en/#preservesymlinks) option.
@@ -181,14 +191,17 @@ By default this plugin will prefer built-ins over local modules, marking them as
181
191
 
182
192
  See [`preferBuiltins`](#preferbuiltins).
183
193
 
184
- To provide stubbed versions of Node built-ins, use a plugin like [rollup-plugin-node-polyfills](https://github.com/ionic-team/rollup-plugin-node-polyfills) or use [`builtin-modules`](https://github.com/sindresorhus/builtin-modules) with `external`, and set `preferBuiltins` to `false`. e.g.
194
+ To provide stubbed versions of Node built-ins, use a plugin like [rollup-plugin-node-polyfills](https://github.com/ionic-team/rollup-plugin-node-polyfills) and set `preferBuiltins` to `false`. e.g.
185
195
 
186
196
  ```js
187
197
  import { nodeResolve } from '@rollup/plugin-node-resolve';
188
- import builtins from 'builtin-modules'
198
+ import nodePolyfills from 'rollup-plugin-node-polyfills';
189
199
  export default ({
190
200
  input: ...,
191
- plugins: [nodeResolve()],
201
+ plugins: [
202
+ nodePolyfills(),
203
+ nodeResolve({ preferBuiltins: false })
204
+ ],
192
205
  external: builtins,
193
206
  output: ...
194
207
  })