2016-01-23 102 views
3

当我使用巴贝尔编译JS时,config.js当我使用巴贝尔编译JS,代理没有定义

var webpack = require('webpack'); 
var commonsPlugin = new webpack.optimize.CommonsChunkPlugin('common.js'); 

module.exports = { 
    entry: { 
     Index: './index.js', 
     Test: './test.js' 
    }, 
    output: { 
     path: __dirname, 
     filename: '[name].js' // Template based on keys in entry above 
    }, 
    module: { 
     loaders: [ 
      { 
       test: /\.js(x?)$/, 
       loader: 'babel-loader', 
       query: { 
       presets: ['es2015'] 
       } 
      } 
     ] 
    }, 
    plugins: [commonsPlugin] 
}; 

我进入JS只是console.log(new Proxy());,在Chrome将调用错误Uncaught ReferenceError: Proxy is not defined

我确定js已编译,但为什么Proxy没有在babel编译后定义?

+1

您是否尝试过通天-插件代理? –

回答

相关问题