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
@@ -109,7 +111,9 @@ The consumer also can use the library loading it with the script tag:
109
111
</script>
110
112
</html>
111
113
```
114
+
112
115
The configurations also can expose the library in the next ways:
116
+
113
117
- Property in the global object, for node.
114
118
- Property in the this object.
115
119
@@ -127,6 +131,7 @@ Now the agenda is to bundle this library achieving the next goals:
127
131
- Being able to access the library inside Node.js.s
128
132
129
133
Also, the consumer will be able to access` the library the `next ways:
134
+
130
135
- ES2015 module. i.e. `import webpackNumbers from 'webpack-numbers'`.
131
136
- CommonJS module. i.e. `require('webpack-numbers')`.
132
137
- Global variable when included through `script` tag.
@@ -218,6 +223,7 @@ module.exports = {
218
223
```
219
224
220
225
W>At the moment of webpack 3.5.5, using the next configuration is not working properly as stated in the [issue 4824](https://github.com/webpack/webpack/issues/4824):
226
+
221
227
```javascript
222
228
module.exports= {
223
229
...
@@ -232,6 +238,7 @@ module.exports = {
232
238
};
233
239
```
234
240
241
+
W> However, you can set libraryTarget.var='_' to expect the library as a global variable
235
242
236
243
### Add `libraryTarget`
237
244
@@ -267,7 +274,9 @@ module.exports = {
267
274
...
268
275
};
269
276
```
277
+
270
278
You can expose the library in the next ways:
279
+
271
280
- Variable: as a global variable. Available in the `script` tag. i.e. `libraryTarget:'var'`.
272
281
- This: available trough the this object. i.e. `libraryTarget:'this'`.
273
282
- Window: available trough the `window` object, in the browser. i.e. `libraryTarget:'window'`.
0 commit comments