@rollup/plugin-node-resolve 11.0.0 → 11.2.0
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 +46 -0
- package/README.md +16 -3
- package/dist/cjs/index.js +396 -122
- package/dist/es/index.js +396 -122
- package/package.json +1 -1
- package/types/index.d.ts +2 -0
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,51 @@
|
|
1
1
|
# @rollup/plugin-node-resolve ChangeLog
|
2
2
|
|
3
|
+
## v11.2.0
|
4
|
+
|
5
|
+
_2021-02-14_
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
- feat: add `ignoreSideEffectsForRoot` option (#694)
|
10
|
+
|
11
|
+
### Updates
|
12
|
+
|
13
|
+
- chore: mark `url` as an external and throw on warning (#783)
|
14
|
+
- docs: clearer "Resolving Built-Ins" doc (#782)
|
15
|
+
|
16
|
+
## v11.1.1
|
17
|
+
|
18
|
+
_2021-01-29_
|
19
|
+
|
20
|
+
### Bugfixes
|
21
|
+
|
22
|
+
- fix: only log last resolve error (#750)
|
23
|
+
|
24
|
+
### Updates
|
25
|
+
|
26
|
+
- docs: add clarification on the order of package entrypoints (#768)
|
27
|
+
|
28
|
+
## v11.1.0
|
29
|
+
|
30
|
+
_2021-01-15_
|
31
|
+
|
32
|
+
### Features
|
33
|
+
|
34
|
+
- feat: support pkg imports and export array (#693)
|
35
|
+
|
36
|
+
## v11.0.1
|
37
|
+
|
38
|
+
_2020-12-14_
|
39
|
+
|
40
|
+
### Bugfixes
|
41
|
+
|
42
|
+
- fix: export map specificity (#675)
|
43
|
+
- fix: add missing type import (#668)
|
44
|
+
|
45
|
+
### Updates
|
46
|
+
|
47
|
+
- docs: corrected word "yse" to "use" (#723)
|
48
|
+
|
3
49
|
## v11.0.0
|
4
50
|
|
5
51
|
_2020-11-30_
|
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,
|
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
|
198
|
+
import nodePolyfills from 'rollup-plugin-node-polyfills';
|
189
199
|
export default ({
|
190
200
|
input: ...,
|
191
|
-
plugins: [
|
201
|
+
plugins: [
|
202
|
+
nodePolyfills(),
|
203
|
+
nodeResolve({ preferBuiltins: false })
|
204
|
+
],
|
192
205
|
external: builtins,
|
193
206
|
output: ...
|
194
207
|
})
|