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

webpack-node-externals

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-node-externals

Easily exclude node_modules in Webpack bundle

  • 2.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.9M
decreased by-4.48%
Maintainers
1
Weekly downloads
 
Created

What is webpack-node-externals?

The webpack-node-externals package is a utility for Webpack that allows you to exclude node_modules from your Webpack bundle. This is particularly useful for Node.js applications where you want to keep your bundle size small and avoid bundling dependencies that are already available in the node_modules directory.

What are webpack-node-externals's main functionalities?

Exclude node_modules

This feature allows you to exclude all modules in the node_modules directory from your Webpack bundle. This is useful for server-side applications where you don't want to bundle dependencies that are already available in the node_modules directory.

const nodeExternals = require('webpack-node-externals');

module.exports = {
  // Other webpack configuration options
  externals: [nodeExternals()]
};

Whitelist specific modules

This feature allows you to specify certain modules that should not be excluded from the bundle, even if they are in the node_modules directory. This is useful if you have a module that you want to include in your bundle for some reason.

const nodeExternals = require('webpack-node-externals');

module.exports = {
  // Other webpack configuration options
  externals: [nodeExternals({
    whitelist: ['module-name']
  })]
};

Custom file extensions

This feature allows you to read the list of modules to exclude from a file, such as package.json. This can be useful for more complex configurations where you want to manage the list of external modules in a separate file.

const nodeExternals = require('webpack-node-externals');

module.exports = {
  // Other webpack configuration options
  externals: [nodeExternals({
    modulesFromFile: true
  })]
};

Other packages similar to webpack-node-externals

Keywords

FAQs

Package last updated on 08 Jul 2020

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