让Webpack2打包JS支持IE8

参考https://www.maizhiying.me/posts/2017/03/01/webpack-babel-ie8-support.html

  1. 安装es3ify-loader
  2. 添加规则
      {
        test: /\.js$/,
        loader: 'es3ify-loader'
      },
  1. 配置uglifyjsplugin
    new webpack.optimize.UglifyJsPlugin({
      compress: {
          warnings: false,
          properties: false
      },
      output: {
        keep_quoted_props: true
      },
      mangle: {
        screw_ie8: false,
        except: ['e']
      }
    })

更多:
https://feifeiyum.github.io/2017/01/11/webpack2-intro/
http://www.aliued.com/?p=3240
http://imweb.io/topic/5868e1abb3ce6d8e3f9f99bb

你可能感兴趣的:(让Webpack2打包JS支持IE8)