安装 react

npm install --save react react-dom
`</pre>

### 安装 babel-loader

<pre>`npm install --save-dev babel-loader babel-core babel-preset-es2015 babel-preset-react babel-preset-stage-2
// 支持 ES2015, JSX, ES7
`</pre>

<pre>`npm install --save polyfill
`</pre>

<pre>`npm install --save babel-runtime
npm install --save-dev babel-plugin-transform-runtime
// 减少打包时候的重复代码
`</pre>

### 配置 babel

<pre>`// 在入口添加 polyfill
entry:[
  'babel-polyfill',
  'webpack/hot/dev-server',
  'webpack-dev-server/client?http://localhost:8080'
]
`</pre>

添加`.babalrc`

<pre>`{
  "presets":[
    "es2015",
    "react",
    "stage-2"
  ],
  "plugins":[
    "transform-runtime"
  ]
}