vue打包兼容IE11
-
确保安装过
babel-loader
和babel-polyfill
cnpm i babel-loader babel-polyfill -D
-
将webpack配置文件修改为
entry: { app:['babel-polyfill', './src/main.js'] }
{ test: /\.js$/, loader: 'babel-loader?cacheDirectory', include: [ resolve('src'), resolve('test'), resolve('node_modules/_element-ui@2.4.7@element-ui/src'), resolve('node_modules/_element-ui@2.4.7@element-ui/package') ] } // 上述element-ui文件目录以本地 node_modules 中 element-ui 文件夹名称为准
-
重新打包即可