Matt Matt - 1 year ago 131
Javascript Question

Webpack externals configuration - root key

What does it mean and what is

for in Webpack externals configuration?

module.exports = {
output: {
libraryTarget: "umd"
externals: [
"subtract": {
root: "subtract",
commonjs2: "./subtract",
commonjs: ["./math", "subtract"],
amd: "subtract"

Answer Source

Check the answer here:

webpack umd lib and external files

Basically it applies to UMD modules and it is used to solve global dependencies when your module is loaded using the <script> tag or well a CDN repo.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download