docs: Clarifying babel/webpack docs (#1845)

This commit is contained in:
Griffin 2017-07-12 23:38:36 -04:00 committed by Pat Cavit
parent 482f0e71b9
commit 353bbe7fff

View file

@ -98,7 +98,7 @@ npm install babel-core babel-loader babel-preset-es2015 babel-plugin-transform-r
Create a `.babelrc` file:
```
```json
{
"presets": ["es2015"],
"plugins": [
@ -130,6 +130,8 @@ module.exports = {
}
```
For those familiar with Webpack already, please note that adding the Babel options to the `babel-loader` section of your `webpack.config.js` will throw an error, so you need to include them in the separate `.babelrc` file.
This configuration assumes the source code file for the application entry point is in `src/index.js`, and this will output the bundle to `bin/app.js`.
To run the bundler, setup an npm script. Open `package.json` and add this entry under `"scripts"`: