美文网首页
在配置webpack时开启babel-loader缓存

在配置webpack时开启babel-loader缓存

作者: demoxjl | 来源:发表于2020-05-09 11:33 被阅读0次

在babel-loader执行的时候,在运行期间可能会产生一些重复的公共文件,造成代码冗余,减慢编译效率,我们可以在配置babel-loader时配置一个参数cacheDiretory,开启缓存

  {
    test: /\.js$/,
    loader: 'babel-loader?cacheDirectory
  }

相关文章

网友评论

      本文标题:在配置webpack时开启babel-loader缓存

      本文链接:https://www.haomeiwen.com/subject/ruohnhtx.html