Skip to content

Commit dba9a85

Browse files
kevinzwhuangjoshwiens
authored andcommitted
docs: Adds -loader suffix on examples for Webpack 2
1 parent 505edd5 commit dba9a85

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ be exposed.
1010
## Usage
1111

1212
``` javascript
13-
require("expose?libraryName!./file.js");
13+
require("expose-loader?libraryName!./file.js");
1414
// Exposes the exports for file.js to the global context on property "libraryName".
1515
// In web browsers, window.libraryName is then available.
1616
```
1717

1818
This line works to expose React to the web browser to enable the Chrome React devtools:
1919

2020
```
21-
require("expose?React!react");
21+
require("expose-loader?React!react");
2222
```
2323

2424
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:
2828
```
2929
module: {
3030
loaders: [
31-
{ test: require.resolve("react"), loader: "expose?React" }
31+
{ test: require.resolve("react"), loader: "expose-loader?React" }
3232
]
3333
}
3434
```
3535
Also for multiple expose you can use `!` in loader string:
3636
```
3737
module: {
3838
loaders: [
39-
{ test: require.resolve("jquery"), loader: "expose?$!expose?jQuery" },
39+
{ test: require.resolve("jquery"), loader: "expose-loader?$!expose-loader?jQuery" },
4040
]
4141
}
4242
```

0 commit comments

Comments
 (0)