1.cnpm安装
cnpm i babel-polyfill --save
cnpm i es6-promise --save
2.main.js引入
import ‘babel-polyfill‘
import Es6Promise from ‘es6-promise‘
Es6Promise.polyfill()
3.webpack.base.conf.js
module.exports = {
entry: {
"babel-polyfill":"babel-polyfill",
app: ‘./src/main.js‘
}
如果还有问题,先根据报错信息网上搜索一下处理方案