当我使用babel编译js时,config.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编译后没有定义?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句