Skip to content
This repository was archived by the owner on Sep 25, 2021. It is now read-only.

Commit 5a0981e

Browse files
authoredJul 19, 2016
Detailed instructions for Babel presets
Include an example of specifying babel presets from within the webpack configuration, since it's not obvious how to do this if you're not using a separate babel config. Linked to babelrc doc and 'Setting up Babel 6' article since the syntax shown in the previously linked article for including query parameters doesn't work in this case as there are multiple loaders used.
1 parent 155f662 commit 5a0981e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed
 

‎README.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,18 @@ As of `babel@6.0` you must specify your
8989
[`presets`](http://babeljs.io/docs/plugins/#presets) to get this to work with
9090
`React`.
9191

92-
See [Quick guide: how to update Babel 5.x ->
93-
6.x](https://medium.com/@malyw/how-to-update-babel-5-x-6-x-d828c230ec53#.3z99fxfmq)
94-
for more details.
92+
Presets can be specified as part of a [Babel config](https://babeljs.io/docs/usage/babelrc/) as outlined in [Setting up Babel 6](https://babeljs.io/blog/2015/10/31/setting-up-babel-6), or you may specify Babel presets for your loader within your webpack configuration:
93+
94+
~~~js
95+
// file: webpack.config.js
96+
module.exports = {
97+
98+
loaders: [
99+
{ test: /\.svg$/, loader: 'babel?presets[]=es2015,presets[]=react!svg-react' }
100+
],
101+
102+
}
103+
~~~
95104

96105

97106
### React Before Version 0.14.0

0 commit comments

Comments
 (0)
Failed to load comments.