[Feature Request] allow a node_module to specify its externals

Do you want to request a feature or report a bug?

Requesting a Feature.

What is the current behavior?

A node_module cannot specify it’s own externals. This forces the consumers of said node_module to set configurations, breaking encapsulation and resulting in a very poor usage experience, and a poor node_module maintainer experience.

What is the expected behavior?

Some what for the node_module to specify its externals.

As an example browserify accomplishes this via the browser field in package.json

note: It may be worth considering not only allowing for webpack specific externals config, but also supporting browserify’s as it will allow existing modules to “Just Work”.

If this is a feature request, what is motivation or use case for changing the behavior?

This forces either:

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.

This is currently an issue for all version of webpack. As of writing this issue, the current version of webpack is 3.10.0

Author: Fantashit

1 thought on “[Feature Request] allow a node_module to specify its externals

  1. As an example browserify accomplishes this via the browser field in package.json

    webpack also supports the browser field when targeting the browser.

Comments are closed.