JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5275187
  • Score
    100M100P100Q222829F
  • License MIT

Allows not bundling node_modules in Webpack

Package Exports

  • webpack-node-externals

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (webpack-node-externals) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Skips bundling node_modules in Webpack

Version Build Status

Webpack allows you to define externals - modules that should not be bundled.

When bundling with Webpack for the backend - you usually wouldn't want to bundle its node_modules dependencies. This library creates an externals function that ignores node_modules when bundling in Webpack.

Quick usage

npm install webpack-node-externals --save-dev

In webpack.config.js:

var nodeExternals = require('webpack-node-externals');
...
module.exports = {
    ...
    target: 'node', // in order to ignore built-in modules like path, fs, etc.
    externals: [nodeExternals()], // in order to ignore all modules in node_modules folder
    ...
};

Detailed overview

Test

npm run test

License

MIT