babel-pollyfill 官方说的是:
With webpack.config.js, add babel-polyfill to your entry array:
With webpack.config.js, add babel-polyfill to your entry array:
module.exports = {
entry: ["babel-polyfill", "./app/js"]
};
但是项目没有webpack.config.js, 倒是有 build/webpack.base.conf.js。 但是里面的结构为:
module.exports = {
entry: {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
}
...
entry: ["babel-polyfill", "./app/js"] 该怎么加进去呢?
main.js 里面引入
webpack.base.conf.js 替换到entry部分
注意:多试一下,清空缓存,多试试,我也是捣鼓捣鼓才可以的