You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(config): elaborate on array usage in externals (#1348)
To make it easier to discover use case reported by webpack/webpack#4665
from the documentation, as the existing array example only convey/imply
that only modules are supported by this construct.
Copy file name to clipboardExpand all lines: content/configuration/externals.md
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -88,9 +88,17 @@ externals : {
88
88
root:"_"// indicates global variable
89
89
}
90
90
}
91
+
92
+
// or
93
+
94
+
externals : {
95
+
subtract : {
96
+
root: ["math", "subtract"]
97
+
}
98
+
}
91
99
```
92
100
93
-
This syntax is used to describe all the possible ways that an external library can be available. `lodash` here is available as `lodash` under AMD and CommonJS module systems but available as `_` in a global variable form.
101
+
This syntax is used to describe all the possible ways that an external library can be available. `lodash` here is available as `lodash` under AMD and CommonJS module systems but available as `_` in a global variable form.`subtract` here is available via the property `subtract` under the global `math` object (e.g. `window['math']['subtract']`).
0 commit comments