webpack ES6转ES5

浏览器适配

Loaders
cnpm install babel-loader@7 babel-core babel-preset-es2015 --save-dev

webpack.config.js

{
  test: /\.m?js$/,
  exclude: /(node_modules|bower_components)/,
  use: {
    loader: 'babel-loader',
    options: {
      presets: ['es2015']
    }
  }
}
posted @ 2021-07-07 14:07  thomas_blog  阅读(126)  评论(0编辑  收藏  举报