引起的主要原因是,ie无法解析es6语法。需要引入babel-polyfill
第一步:npm install babel-polyfill --save-dev
第二步:在webpack.base.config.js中
require('babel-polyfill')
module.exports = {
entry: {
app: ['babel-polyfill', './src/main.js']
}
}
有些插件还出错需要另外设置(例如iview)
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'), resolve('node_modules/iview')]
},
参考:解决webpack项目在ie下报错