With eslint-webpack-plugin@2.4.1, how do you use eslint’s cache?

Tags: , , ,



After switching from eslint-loader, our initial watch builds have slowed down substantially due to the lack of caching. Is there a way to use eslint’s cache?

Answer

ESLint’s node api has cache and cacheLocation keys in it, and setting those like

const ESLintPlugin = require('eslint-webpack-plugin')

module.exports = {
  plugins: [
    new ESLintPlugin({
      cache: true, 
      cacheLocation
    })
  ]
}

enables caching like eslint-webpack-loader‘s old caching behavior.



Source: stackoverflow