Skip to content

Commit 893865f

Browse files
committed
- Fix increasing memory usage in watch mode.
- Consider an empty include option means 'includes all'.
1 parent 7812404 commit 893865f

File tree

10 files changed

+292
-2977
lines changed

10 files changed

+292
-2977
lines changed

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"typescript.tsdk": "node_modules\\typescript\\lib"
2+
"typescript.tsdk": "node_modules\\typescript\\lib",
3+
"javascript.preferences.importModuleSpecifierEnding": "js",
4+
"typescript.preferences.importModuleSpecifierEnding": "js",
5+
"js/ts.implicitProjectConfig.module": "NodeNext"
36
}

README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ If you're working with monorepos, the `packagePath` option is made for you. It c
9999
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.
100100

101101
#### include?: string | RegExp | (string | RegExp)[] = []
102-
#### exclude?: string | RegExp | (string | RegExp)[] = []
103102
Use the `include` option to force certain dependencies into the list of externals, regardless of other settings:
104103
```js
105104
externals({
@@ -108,6 +107,7 @@ externals({
108107
})
109108
```
110109

110+
#### exclude?: string | RegExp | (string | RegExp)[] = []
111111
Conversely, use the `exclude` option to remove certain dependencies from the list of externals, regardless of other settings:
112112
```js
113113
externals({
@@ -118,10 +118,11 @@ externals({
118118

119119
## Notes
120120
### 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.
122123

123124
### 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.:
125126

126127
```js
127128
// In your code, say '@/' is mapped to some directory:
@@ -137,9 +138,6 @@ externals({
137138
})
138139
```
139140

140-
However, subpath imports are supported with regexes, meaning that `include: /^lodash/` will externalize `lodash` and also `lodash/map`, `lodash/merge`, etc.
141-
142-
143141
### 3/ Order matters
144142
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:
145143

@@ -166,14 +164,14 @@ Rollup's own `external` configuration option always takes precedence over this p
166164
<details><summary>(click to expand)</summary>
167165

168166
### 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.
170168
- 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.
172170
- `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`.
174172

175173
### 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`.
177175
- Now requires Node 14 (up from Node 12 for previous versions).
178176
- Now has a _peer dependency_ on `rollup ^2.60.0`.
179177
</summary>

0 commit comments

Comments
 (0)