Closed
Description
The documentation makes us believe that this example:
module.exports = {
//...
externals: {
jquery: 'jQuery'
}
};
will result in jquery
imports to be replaced with jQuery
variable:
In other words, when a string is provided it will be treated as root (defined above and below).
root: The library should be available as a global variable (e.g. via a script tag).
However it's not exactly true.
The default type of externals is defined by externalsType
option. Which is by default defined as follows:
https://github.com/webpack/webpack/blob/master/lib/config/defaults.js#L189-L198
So for example in case of commonjs library target import $ from 'jquery';
will be transformed to require("jQuery")
.
Metadata
Metadata
Assignees
Labels
No labels