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
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,9 +36,9 @@ This library scans the `node_modules` folder for all node_modules names, and bui
36
36
### Configuration
37
37
This library accepts an `options` object.
38
38
39
-
#### `options.whitelist (=[])`
40
-
An array for the `externals` to whitelist, so they **will** be included in the bundle. Can accept exact strings (`'module_name'`), regex patterns (`/^module_name/`), or a function that accepts the module name and returns whether it should be included.
41
-
<br/>**Important** - if you have set aliases in your webpack config with the exact same names as modules in *node_modules*, you need to whitelist them so Webpack will know they should be bundled.
39
+
#### `options.allowlist (=[])`
40
+
An array for the `externals` to allow, so they **will** be included in the bundle. Can accept exact strings (`'module_name'`), regex patterns (`/^module_name/`), or a function that accepts the module name and returns whether it should be included.
41
+
<br/>**Important** - if you have set aliases in your webpack config with the exact same names as modules in *node_modules*, you need to allowlist them so Webpack will know they should be bundled.
42
42
43
43
#### `options.importType (='commonjs')`
44
44
The method in which unbundled modules will be required in the code. Best to leave as `commonjs` for node modules.
@@ -75,7 +75,7 @@ module.exports = {
75
75
target:'node', // important in order not to bundle built-in modules like path, fs, etc.
76
76
externals: [nodeExternals({
77
77
// this WILL include `jquery` and `webpack/hot/dev-server` in the bundle, as well as `lodash/*`
@@ -99,12 +99,12 @@ However, this will leave unbundled **all non-relative requires**, so it does not
99
99
This library scans the `node_modules` folder, so it only leaves unbundled the actual node modules that are being used.
100
100
101
101
#### How can I bundle required assets (i.e css files) from node_modules?
102
-
Using the `whitelist` option, this is possible. We can simply tell Webpack to bundle all files with extensions that are not js/jsx/json, using this [regex](https://regexper.com/#%5C.(%3F!(%3F%3Ajs%7Cjson)%24).%7B1%2C5%7D%24):
102
+
Using the `allowlist` option, this is possible. We can simply tell Webpack to bundle all files with extensions that are not js/jsx/json, using this [regex](https://regexper.com/#%5C.(%3F!(%3F%3Ajs%7Cjson)%24).%7B1%2C5%7D%24):
103
103
```js
104
104
...
105
105
nodeExternals({
106
106
// load non-javascript files with extensions, presumably via loaders
0 commit comments