缓存babel-loader

设置cacheDirectorytrue,可以避免重复打包,相同代码直接使用缓存

module.exports = {
  module: {
    rules: [
      {
        test: /\.js$/,
        include: srcPath,
        exclude: /node_modules/,
        use: [
          {
            loader: 'babel-loader',
            options: {
              cacheDirectory: true
            }
          }
        ]
      }
    ]
  }
}

results matching ""

    No results matching ""