當我使用巴貝爾編譯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編譯後定義?
您是否嘗試過通天-插件代理? –