前言
微软爸爸都把IE干掉了,还有客户在用,木得办法啊
内容
- 安装
babel-polyfill
插件
npm install --save babel-polyfill
- 在
main.js
中引入babel-polyfill
import 'babel-polyfill'
- 修改
config
中的webpack.base.conf.js
配置
entry: {
app: ['babel-polyfill', './src/main.js']
},
- 安装
es6-promise
兼容axios
npm install --save es6-promise
main.js
中引入es6-promise
import 'es6-promise/auto'
- 兼容
element-ui
将element-ui组件的resolve进来
{
test: /.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client'),resolve('/node_modules/element-ui/src'),resolve('/node_modules/element-ui/packages')]
},