Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(README): remove outdated React references #42

Merged
merged 1 commit into from
Apr 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,39 @@ require("expose-loader?libraryName!./file.js");
// In web browsers, window.libraryName is then available.
```

This line works to expose React to the web browser to enable the Chrome React devtools:
For example, let's say you want to expose jQuery as a global called `$`:

```
require("expose-loader?React!react");
require("expose-loader?$!jquery");
```

Thus, `window.React` is then available to the Chrome React devtools extension.
Thus, `window.$` is then available in the browser console.

Alternately, you can set this in your config file:

webpack v1 usage
```
module: {
loaders: [
{ test: require.resolve("react"), loader: "expose-loader?React" }
{ test: require.resolve("jquery"), loader: "expose-loader?$" }
]
}
```
webpack v2 usage
```
module: {
rules: [{
test: require.resolve('react'),
test: require.resolve('jquery'),
use: [{
loader: 'expose-loader',
options: 'React'
options: '$'
}]
}]
}
```
Also for multiple expose you can use `!` in loader string:

Let's say you also want to expose it as `window.jQuery` in addition to `window.$`.
For multiple expose you can use `!` in loader string:

webpack v1 usage
```
Expand Down