pnp-node-externals

This is the pnp support version of webpack-node-externals.

Usage no npm install needed!

<script type="module">
  import pnpNodeExternals from 'https://cdn.skypack.dev/pnp-node-externals';
</script>

README

Plug'n'Play Webpack Node Externals

This is the pnp support version of webpack-node-externals.

However, it does not provide additional options, such as including certain modules in the bundle with allowlist.

When using this package, all imports are not included in the bundle.

Quick usage

$ yarn add pnp-node-externals --dev

In your webpack.config.js

const pnpNodeExternals = require('pnp-node-externals')

module.exports = {
  // ...
  target: 'node',
  externals: [
    pnpNodeExternals(),
  ]
}

Reference