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

feat(gatsby): Add webpack fs caching for development flag #32264

Merged
merged 10 commits into from
Jul 15, 2021
16 changes: 16 additions & 0 deletions packages/gatsby/src/utils/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,22 @@ const activeFlags: Array<IFlag> = [
}
},
},
{
name: `DEV_WEBPACK_CACHE`,
env: `GATSBY_EXPERIMENTAL_DEV_WEBPACK_CACHE`,
command: `develop`,
telemetryId: `DevWebackCache`,
experimental: false,
description: `Enable webpack's filesystem caching during development. Speeds up the start of the development server.`,
// umbrellaIssue: `https://gatsby.dev/dev-ssr-feedback`,
testFitness: (): fitnessEnum => {
if (sampleSiteForExperiment(`DEV_WEBPACK_CACHE`, 20)) {
return `OPT_IN`
} else {
return true
}
},
},
{
name: `QUERY_ON_DEMAND`,
env: `GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND`,
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby/src/utils/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -783,8 +783,8 @@ module.exports = async (
}

if (
process.env.GATSBY_EXPERIMENTAL_PRESERVE_WEBPACK_CACHE &&
(stage === `build-javascript` || stage === `build-html`)
process.env.GATSBY_EXPERIMENTAL_DEV_WEBPACK_CACHE &&
(stage === `develop` || stage === `develop-html`)
KyleAMathews marked this conversation as resolved.
Show resolved Hide resolved
) {
const cacheLocation = path.join(
program.directory,
Expand Down