@@ -36,13 +36,13 @@ The documentation and syntax examples can be read [here](#syntax).
36
36
> ⚠ ` %20 ` is space in a query string, because you can't use spaces in URLs
37
37
38
38
``` js
39
- import $ from ' expose-loader?exposes[]=$&exposes[]=jQuery!jquery' ;
39
+ import $ from " expose-loader?exposes[]=$&exposes[]=jQuery!jquery" ;
40
40
//
41
41
// Adds the `jquery` to the global object under the names `$` and `jQuery`
42
42
```
43
43
44
44
``` js
45
- import { concat } from ' expose-loader?exposes=_.concat!lodash/concat' ;
45
+ import { concat } from " expose-loader?exposes=_.concat!lodash/concat" ;
46
46
//
47
47
// Adds the `lodash/concat` to the global object under the name `_.concat`
48
48
```
@@ -51,7 +51,7 @@ import { concat } from 'expose-loader?exposes=_.concat!lodash/concat';
51
51
import {
52
52
map ,
53
53
reduce ,
54
- } from ' expose-loader?exposes[]=_.map|map&exposes[]=_.reduce|reduce!underscore' ;
54
+ } from " expose-loader?exposes[]=_.map|map&exposes[]=_.reduce|reduce!underscore" ;
55
55
//
56
56
// Adds the `map` and `reduce` method from `underscore` to the global object under the name `_.map` and `_.reduce`
57
57
```
@@ -61,7 +61,7 @@ import {
61
61
** src/index.js**
62
62
63
63
``` js
64
- import $ from ' jquery' ;
64
+ import $ from " jquery" ;
65
65
```
66
66
67
67
** webpack.config.js**
@@ -71,25 +71,25 @@ module.exports = {
71
71
module: {
72
72
rules: [
73
73
{
74
- test: require .resolve (' jquery' ),
75
- loader: ' expose-loader' ,
74
+ test: require .resolve (" jquery" ),
75
+ loader: " expose-loader" ,
76
76
options: {
77
- exposes: [' $ ' , ' jQuery' ],
77
+ exposes: [" $ " , " jQuery" ],
78
78
},
79
79
},
80
80
{
81
- test: require .resolve (' underscore' ),
82
- loader: ' expose-loader' ,
81
+ test: require .resolve (" underscore" ),
82
+ loader: " expose-loader" ,
83
83
options: {
84
84
exposes: [
85
- ' _.map|map' ,
85
+ " _.map|map" ,
86
86
{
87
- globalName: ' _.reduce' ,
88
- moduleLocalName: ' reduce' ,
87
+ globalName: " _.reduce" ,
88
+ moduleLocalName: " reduce" ,
89
89
},
90
90
{
91
- globalName: [' _ ' , ' filter' ],
92
- moduleLocalName: ' filter' ,
91
+ globalName: [" _ " , " filter" ],
92
+ moduleLocalName: " filter" ,
93
93
},
94
94
],
95
95
},
@@ -137,7 +137,7 @@ If `moduleLocalName` is not specified, it exposes the entire module to the globa
137
137
** src/index.js**
138
138
139
139
``` js
140
- import _ from ' underscore' ;
140
+ import _ from " underscore" ;
141
141
```
142
142
143
143
** webpack.config.js**
@@ -147,11 +147,11 @@ module.exports = {
147
147
module: {
148
148
rules: [
149
149
{
150
- test: require .resolve (' jquery' ),
151
- loader: ' expose-loader' ,
150
+ test: require .resolve (" jquery" ),
151
+ loader: " expose-loader" ,
152
152
options: {
153
153
// For `underscore` library, it can be `_.map map` or `_.map|map`
154
- exposes: ' jquery' ,
154
+ exposes: " jquery" ,
155
155
},
156
156
},
157
157
],
@@ -173,7 +173,7 @@ The name in the global object. (**required**).
173
173
** src/index.js**
174
174
175
175
``` js
176
- import _ from ' underscore' ;
176
+ import _ from " underscore" ;
177
177
```
178
178
179
179
** webpack.config.js**
@@ -183,13 +183,13 @@ module.exports = {
183
183
module: {
184
184
rules: [
185
185
{
186
- test: require .resolve (' underscore' ),
187
- loader: ' expose-loader' ,
186
+ test: require .resolve (" underscore" ),
187
+ loader: " expose-loader" ,
188
188
options: {
189
189
exposes: {
190
190
// Can be `['_', 'filter']`
191
- globalName: ' _.filter' ,
192
- moduleLocalName: ' filter' ,
191
+ globalName: " _.filter" ,
192
+ moduleLocalName: " filter" ,
193
193
},
194
194
},
195
195
},
@@ -209,7 +209,7 @@ If `moduleLocalName` is specified, it exposes only the value of `moduleLocalName
209
209
** src/index.js**
210
210
211
211
``` js
212
- import _ from ' underscore' ;
212
+ import _ from " underscore" ;
213
213
```
214
214
215
215
** webpack.config.js**
@@ -219,12 +219,12 @@ module.exports = {
219
219
module: {
220
220
rules: [
221
221
{
222
- test: require .resolve (' underscore' ),
223
- loader: ' expose-loader' ,
222
+ test: require .resolve (" underscore" ),
223
+ loader: " expose-loader" ,
224
224
options: {
225
225
exposes: {
226
- globalName: ' _.filter' ,
227
- moduleLocalName: ' filter' ,
226
+ globalName: " _.filter" ,
227
+ moduleLocalName: " filter" ,
228
228
},
229
229
},
230
230
},
@@ -247,7 +247,7 @@ To force override the value that is already present in the global object you can
247
247
** src/index.js**
248
248
249
249
``` js
250
- import $ from ' jquery' ;
250
+ import $ from " jquery" ;
251
251
```
252
252
253
253
** webpack.config.js**
@@ -257,11 +257,11 @@ module.exports = {
257
257
module: {
258
258
rules: [
259
259
{
260
- test: require .resolve (' jquery' ),
261
- loader: ' expose-loader' ,
260
+ test: require .resolve (" jquery" ),
261
+ loader: " expose-loader" ,
262
262
options: {
263
263
exposes: {
264
- globalName: ' $ ' ,
264
+ globalName: " $ " ,
265
265
override: true ,
266
266
},
267
267
},
@@ -276,7 +276,7 @@ module.exports = {
276
276
** src/index.js**
277
277
278
278
``` js
279
- import _ from ' underscore' ;
279
+ import _ from " underscore" ;
280
280
```
281
281
282
282
** webpack.config.js**
@@ -286,18 +286,18 @@ module.exports = {
286
286
module: {
287
287
rules: [
288
288
{
289
- test: require .resolve (' underscore' ),
290
- loader: ' expose-loader' ,
289
+ test: require .resolve (" underscore" ),
290
+ loader: " expose-loader" ,
291
291
options: {
292
292
exposes: [
293
- ' _.map map' ,
293
+ " _.map map" ,
294
294
{
295
- globalName: ' _.filter' ,
296
- moduleLocalName: ' filter' ,
295
+ globalName: " _.filter" ,
296
+ moduleLocalName: " filter" ,
297
297
},
298
298
{
299
- globalName: [' _ ' , ' find' ],
300
- moduleLocalName: ' myNameForFind' ,
299
+ globalName: [" _ " , " find" ],
300
+ moduleLocalName: " myNameForFind" ,
301
301
},
302
302
],
303
303
},
0 commit comments