You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,7 +99,6 @@ If you're working with monorepos, the `packagePath` option is made for you. It c
99
99
Set the `deps`, `devDeps`, `peerDeps` and `optDeps` options to `false` to prevent the corresponding dependencies from being externalized, therefore letting Rollup bundle them with your code.
Conversely, use the `exclude` option to remove certain dependencies from the list of externals, regardless of other settings:
112
112
```js
113
113
externals({
@@ -118,10 +118,11 @@ externals({
118
118
119
119
## Notes
120
120
### 1/ This plugin is smart
121
-
Falsy values in `include` and `exclude` are silently ignored. This allows for conditional constructs like `exclude: process.env.NODE_ENV === 'production' && 'my-prod-only-dep'`.
121
+
- Falsy values in `include` and `exclude` are silently ignored. This allows for conditional constructs like `exclude: process.env.NODE_ENV === 'production' && 'my-prod-only-dep'`.
122
+
- Subpath imports are supported with regexes, meaning that `include: /^lodash/` will externalize `lodash` and also `lodash/map`, `lodash/merge`, etc.
122
123
123
124
### 2/ This plugin is not _that_ smart
124
-
It uses an exact match against your imports, so if your are using some kind of path substitution in your code, eg.:
125
+
It uses an exact match against your imports_as written in your code_, so if your are using some kind of path substitution, eg.:
125
126
126
127
```js
127
128
// In your code, say '@/' is mapped to some directory:
@@ -137,9 +138,6 @@ externals({
137
138
})
138
139
```
139
140
140
-
However, subpath imports are supported with regexes, meaning that `include: /^lodash/` will externalize `lodash` and also `lodash/map`, `lodash/merge`, etc.
141
-
142
-
143
141
### 3/ Order matters
144
142
If you're also using [`@rollup/plugin-node-resolve`](https://github.com/rollup/plugins/tree/master/packages/node-resolve/#readme), make sure this plugin comes _before_ it in the `plugins` array:
145
143
@@ -166,14 +164,14 @@ Rollup's own `external` configuration option always takes precedence over this p
166
164
<details><summary>(click to expand)</summary>
167
165
168
166
### Breaking changes in version 5
169
-
- In previous versions, the `devDeps` option (see below) defaulted to `true`.<br>This was practical, but often wrong: devDependencies are meant just for that: being used when developping. Therefore, the `devDeps` option now defaults to `false`, meaning Rollup will include them in your bundle.
167
+
- In previous versions, the `devDeps` option defaulted to `true`.<br>This was practical, but often wrong: devDependencies are meant just for that: being used when developping. Therefore, the `devDeps` option now defaults to `false`, meaning Rollup will include them in your bundle.
170
168
- As anticipated since v4, the `builtinsPrefix` option now defaults to `'add'`.
171
-
- The deprecated `prefixedBuiltins` option has been removed.
169
+
- The deprecated `prefixedBuiltins` option has been removed. Use `builtinsPrefix` instead.
172
170
-`rollup-plugin-node-externals` no longer depends on the Find-Up package (while this is not a breaking change per se, it can be in some edge situations).
173
-
-Now has a _peer dependency_ on `rollup ^2.60.0 || ^3.0.0`.
171
+
-The plugin now has a _peer dependency_ on `rollup ^2.60.0 || ^3.0.0`.
174
172
175
173
### Breaking changes in version 4
176
-
- In previous versions, the `deps` option (see below) defaulted to `false`.<br>This was practical, but often wrong: when bundling for distribution, you want your own dependencies to be installed by the package manager alongside your package, so they should not be bundled in the code. Therefore, the `deps` option now defaults to `true`.
174
+
- In previous versions, the `deps` option defaulted to `false`.<br>This was practical, but often wrong: when bundling for distribution, you want your own dependencies to be installed by the package manager alongside your package, so they should not be bundled in the code. Therefore, the `deps` option now defaults to `true`.
177
175
- Now requires Node 14 (up from Node 12 for previous versions).
178
176
- Now has a _peer dependency_ on `rollup ^2.60.0`.
0 commit comments