webpack-node-externals
Advanced tools
Comparing version 0.2.0 to 0.3.0
{ | ||
"name": "webpack-node-externals", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Allows you not to bundle node_modules in Webpack", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
Webpack node_modules externals | ||
Webpack node modules externals | ||
============================== | ||
@@ -9,3 +9,3 @@ | ||
When bundling with Webpack for the backend - you usually wouldn't want to bundle its node_modules dependencies. | ||
When bundling with Webpack for the backend - you usually wouldn't want to bundle its `node_modules` dependencies. | ||
This library creates an *externals* function that ignores `node_modules` when bundling in Webpack. | ||
@@ -29,2 +29,3 @@ | ||
``` | ||
And that's it. All node modules will no longer be bundled but will be left as `require('module')`. | ||
@@ -53,20 +54,18 @@ ## Detailed overview | ||
* #### Example | ||
```js | ||
var nodeExternals = require('webpack-node-externals'); | ||
#### Example | ||
```js | ||
var nodeExternals = require('webpack-node-externals'); | ||
... | ||
module.exports = { | ||
... | ||
module.exports = { | ||
... | ||
target: 'node', // important in order not to bundle built-in modules like path, fs, etc. | ||
externals: [nodeExternals({ | ||
whitelist: ['jquery', 'webpack/hot/dev-server'] // this WILL include `jquery` and `webpack/hot/dev-server` in the bundle | ||
})], | ||
... | ||
}; | ||
``` | ||
### Test | ||
```sh | ||
npm run test | ||
target: 'node', // important in order not to bundle built-in modules like path, fs, etc. | ||
externals: [nodeExternals({ | ||
whitelist: ['jquery', 'webpack/hot/dev-server'] | ||
// this WILL include `jquery` and `webpack/hot/dev-server` in the bundle | ||
})], | ||
... | ||
}; | ||
``` | ||
For most use cases, the defaults of `importType` and `modulesDir` should be used. | ||
@@ -88,3 +87,10 @@ ## Q&A | ||
## Contribute | ||
Contributions and pull requests are welcome. Make sure to run the tests to make sure nothing breaks. | ||
### Test | ||
```sh | ||
npm run test | ||
``` | ||
## License | ||
MIT |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6625
93