@nerd-coder/webpack-node-externals

1.8.2 • Public • Published

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

Package Sidebar

Install

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

Weekly Downloads

1

Version

1.8.2

License

MIT

Unpacked Size

7.91 kB

Total Files

5

Last publish

Collaborators

  • toanzzz