Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support persistent cache #241

Open
mvhirsch opened this issue May 16, 2024 · 2 comments
Open

Support persistent cache #241

mvhirsch opened this issue May 16, 2024 · 2 comments

Comments

@mvhirsch
Copy link

Webpack 5 introduced persistent (filesystem based) cache, which speeds up build performance in CI by ... a lot.
This plugin forces my setting always to be false, rendering my cache setup useless in CI.

https://webpack.js.org/guides/build-performance/#persistent-cache

Webpack/Grunt Configuration (webpack.config.js, webpack part of Gruntfile.js)

{
    options: {
        cache: {
            type: 'filesystem',
            cacheDirectory: path.resolve('<%= paths.cache %>/webpack')
        }
    }
}

Expected Behavior

A cached output on destination

Current Behavior

No output

Possible Solution

Context

Your Environment

software version
webpack 5.89.0
grunt-webpack 6.0.0
grunt 1.5.3
node 14.21.3
npm 6.14.18
Operating System Fedora 39 - 6.8.9-200.fc39.x86_64 GNU/Linux
@mvhirsch
Copy link
Author

Looks like unless I want to watch: true (on build servers I usually don't want to watch ...) it's impossible to use build-cache using this module.

if (!options.watch) {
// ensure cache is disabled in non watch mode, as we add our own CachePlugin to support
// multiple targets in one run with different caches
options.cache = false;
}

@alexander-akait
Copy link
Member

/cc @danez friendly ping, we should do it, cache is pretty stable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants