Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kherock/webpack-pnp-unplugged-externals
Exclude unplugged PnP packages from the webpack bundle
https://github.com/kherock/webpack-pnp-unplugged-externals
Last synced: about 1 month ago
JSON representation
Exclude unplugged PnP packages from the webpack bundle
- Host: GitHub
- URL: https://github.com/kherock/webpack-pnp-unplugged-externals
- Owner: kherock
- License: mit
- Created: 2020-04-30T03:17:18.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-01T19:17:56.000Z (about 4 years ago)
- Last Synced: 2024-09-16T08:38:32.205Z (about 2 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[![npm][npm]][npm-url]
[![node][node]][node-url]
[![deps][deps]][deps-url]
[![downloads][downloads]][downloads-url]Install
```bash
yarn add --dev webpack-pnp-unplugged-externals
```Usage
**webpack.config.js**
```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`](https://github.com/kherock/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.[npm]: https://img.shields.io/npm/v/webpack-pnp-unplugged-externals.svg
[npm-url]: https://npmjs.com/package/webpack-pnp-unplugged-externals[node]: https://img.shields.io/node/v/webpack-pnp-unplugged-externals.svg
[node-url]: https://nodejs.org[deps]: https://david-dm.org/kherock/webpack-pnp-unplugged-externals.svg
[deps-url]: https://david-dm.org/kherock/webpack-pnp-unplugged-externals[downloads]: https://img.shields.io/npm/dt/webpack-pnp-unplugged-externals.svg
[downloads-url]: https://npmjs.com/package/webpack-pnp-unplugged-externals