2017-03-03 84 views
0

我有JS裝載機這樣的WebPack配置遷移到的WebPack 2,巴貝爾裝載機錯誤

module: { 
    loaders: [ 
     { 
      test: /\.js?$/, 
      loader: 'babel-loader', 
      exclude: /node_modules/, 
      query: { 
       "presets": ["es2015", "stage-0", "react"], 
       "plugins": ['transform-runtime'] 
      } 
     }, 

它的工作原理,但是當我試圖改變裝載機規則它不工作,我得到thiss錯誤:

ERROR in ./src/index.js 
Module parse failed: D:\src\index.js Unexpected token (16:4) 
You may need an appropriate loader to handle this file type. 
| 
| render(
|  <Router history={browserHistory}> 
|   <Route path='/' component={App}> 
|    <IndexRoute component={Home} /> 

回答