Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

peer-deps-externals-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

peer-deps-externals-webpack-plugin

Webpack plugin to automatically add a library's peerDependencies to its bundle's externals.

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.1K
decreased by-11.53%
Maintainers
1
Weekly downloads
 
Created
Source

Peer Deps Externals Webpack Plugin

Webpack plugin to automatically add a library's peerDependencies to the bundle's externals.

Motivation

When bundling a library using webpack, we generally want to keep from including peerDependencies since they are expected to be provided by the consumer of the library. By excluding these dependencies, we keep bundle size down and avoid bundling duplicate dependencies.

We can achieve this using the webpack externals configuration option, providing it a list of the peer dependencies to exclude from the bundle. This plugin automates the process, automatically adding a library's peerDependencies to the externals configuration.

Installation

npm

npm install --save-dev peer-deps-externals-webpack-plugin

yarn

yarn add --dev peer-deps-externals-webpack-plugin

Usage

// Webpack config
var PeerDepsExternalsPlugin = require('peer-deps-externals-webpack-plugin');

module.exports = {
  plugins: [
    new PeerDepsExternalsPlugin(),
  ],
}

Keywords

FAQs

Package last updated on 08 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc