1.8.2 • Published 5 years ago

@nerd-coder/webpack-node-externals v1.8.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Webpack node modules externals

==============================

Easily exclude node modules in Webpack (with Zero-Config)

Disclaimer

This lib is a forked version of Liad Yosef's webpack-node-externals which do the same thing, but slightly difference usage.

// Original plugin:
    externals: [nodeExternals()]

// This plugin
    plugins: [new NodeExternals()]

Usage

npm i -D @nerd-coder/webpack-node-externals

You can use it in CLI (zero config)

webpack -p --plugin @nerd-coder/webpack-node-externals

Or you can add it into your webpack.config.js

const NodeExternals = require('@nerd-coder/webpack-node-externals')
...
module.exports = {
    ...
    target: 'node', // in order to ignore built-in modules like path, fs, etc.
    plugins: [new NodeExternals()], // in order to ignore all modules in node_modules folder
    ...
}

Options

Please refer to the original docs for detailed available options

License

MIT