1.0.0 • Published 4 years ago

webpack-pnp-unplugged-externals v1.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago
yarn add --dev webpack-pnp-unplugged-externals

webpack.config.js

const pnpUnpluggedExternals = require('webapck-pnp-unplugged-externals');

module.exports = {
  // ...
  externals: [pnpUnpluggedExternals()],
};

To explicitly declare a package as external, simply yarn unplug it from the workspace! (or just add it to the webpack externals array, like usual.)

It's recommended to use this library in conjunction with pnp-package-json-webpack-plugin. Together, it's possible to create a minimal package.json containing only dependencies that webpack normally can't handle, e.g. packages that compile native addons, regardless of where they appear in your dependency tree.