Skip to content

Commit

Permalink
Update webpack usage with Webpack 2 (#717)
Browse files Browse the repository at this point in the history
Webpack 2 changes what's allowed in the externals part of the config, so I updated the docs to have Webpack 1 and Webpack 2 examples.
  • Loading branch information
jackfranklin authored and blainekasten committed Dec 6, 2016
1 parent fae0293 commit 2a85a5f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docs/guides/webpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ react/lib/ReactContext
react/lib/ExecutionEnvironment
```

Here is an example piece of configuration code marking these as external:
Depending on if you are using Webpack 1 or Webpack 2 you will need different configurations.

### Webpack 1

```js
/* webpack.config.js */
Expand All @@ -34,6 +36,18 @@ externals: {
// ...
```

### Webpack 2

```js
externals: {
'cheerio': 'window',
'react/addons': 'react',
'react/lib/ExecutionEnvironment': 'react',
'react/lib/ReactContext': 'react',
},
```


## React 0.14 Compatibility

If you are using React 0.14, the instructions above will be the same but with a different list of
Expand Down

0 comments on commit 2a85a5f

Please sign in to comment.