Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webpack-node-externals

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-node-externals - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

2

package.json
{
"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
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc