【问题标题】:With eslint-webpack-plugin@2.4.1, how do you use eslint's cache?使用 eslint-webpack-plugin@2.4.1,如何使用 eslint 的缓存?
【发布时间】:2021-03-22 06:33:33
【问题描述】:

从 eslint-loader 切换后,由于缺少缓存,我们最初的 watch 构建速度大大减慢。有没有办法使用eslint的缓存?

【问题讨论】:

    标签: javascript typescript webpack eslint


    【解决方案1】:

    ESLint 的 node api 里面有 cachecacheLocation 键,并设置类似

    const ESLintPlugin = require('eslint-webpack-plugin')
    
    module.exports = {
      plugins: [
        new ESLintPlugin({
          cache: true, 
          cacheLocation
        })
      ]
    }
    

    启用缓存,类似于 eslint-webpack-loader 的旧缓存行为。

    【讨论】:

      猜你喜欢
      • 2021-10-18
      • 1970-01-01
      • 2021-06-18
      • 2016-05-27
      • 2018-03-28
      • 2023-03-14
      • 1970-01-01
      • 2016-09-07
      • 2017-01-11
      相关资源
      最近更新 更多