vue2 + Element-ui + webpack 打包兼容 IE11 处理

vue2 + Element-ui + webpack 打包兼容 IE11 处理_第1张图片
  1. 确保安装过babel-loaderbabel-polyfill

    cnpm i babel-loader babel-polyfill -D
    
  2. 将webpack配置文件修改为

    entry: {
        app:['babel-polyfill', './src/main.js']
    }
    
    {
        test: /\.js$/,
        loader: 'babel-loader?cacheDirectory',
        include: [
            resolve('src'),
            resolve('test'),
            resolve('node_modules/[email protected]@element-ui/src'),
            resolve('node_modules/[email protected]@element-ui/package')
        ]
    }
    
    // 上述element-ui文件目录以本地 node_modules 中 element-ui 文件夹名称为准
    
  3. 重新打包即可

你可能感兴趣的:(vue2 + Element-ui + webpack 打包兼容 IE11 处理)