File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -10,15 +10,15 @@ be exposed.
10
10
## Usage
11
11
12
12
``` javascript
13
- require (" expose?libraryName!./file.js" );
13
+ require (" expose-loader ?libraryName!./file.js" );
14
14
// Exposes the exports for file.js to the global context on property "libraryName".
15
15
// In web browsers, window.libraryName is then available.
16
16
```
17
17
18
18
This line works to expose React to the web browser to enable the Chrome React devtools:
19
19
20
20
```
21
- require("expose?React!react");
21
+ require("expose-loader ?React!react");
22
22
```
23
23
24
24
Thus, ` window.React ` is then available to the Chrome React devtools extension.
@@ -28,15 +28,15 @@ Alternately, you can set this in your config file:
28
28
```
29
29
module: {
30
30
loaders: [
31
- { test: require.resolve("react"), loader: "expose?React" }
31
+ { test: require.resolve("react"), loader: "expose-loader ?React" }
32
32
]
33
33
}
34
34
```
35
35
Also for multiple expose you can use ` ! ` in loader string:
36
36
```
37
37
module: {
38
38
loaders: [
39
- { test: require.resolve("jquery"), loader: "expose?$!expose?jQuery" },
39
+ { test: require.resolve("jquery"), loader: "expose-loader ?$!expose-loader ?jQuery" },
40
40
]
41
41
}
42
42
```
You can’t perform that action at this time.
0 commit comments