Skip to content

feat(webpack): add webpackFilesystemCache for production builds#1555

Closed
ak-seek wants to merge 1 commit intoseek-oss:masterfrom
ak-seek:add-webpack-filesystem-cache-config
Closed

feat(webpack): add webpackFilesystemCache for production builds#1555
ak-seek wants to merge 1 commit intoseek-oss:masterfrom
ak-seek:add-webpack-filesystem-cache-config

Conversation

@ak-seek
Copy link
Copy Markdown

@ak-seek ak-seek commented Apr 17, 2026

Summary

  • Adds webpackFilesystemCache to sku.config so consumers can opt in to Webpack 5 filesystem cache for sku build / sku build-ssr and CI.

  • Accepts either a mode ('development' | 'always') or an options object exposing Webpack's advanced cache options:

    webpackFilesystemCache: {
      mode: 'always',
      compression: 'gzip',
      maxAge: 1000 * 60 * 60 * 24 * 7,
      buildDependencies: ['./tsconfig.json'],
    }
  • Sku always invalidates the cache on sku.config.* and on the installed sku version; consumer buildDependencies are appended.

  • Mode override via SKU_WEBPACK_FILESYSTEM_CACHE=development|always; full disable via SKU_DISABLE_CACHE.

  • Default behaviour is unchanged ('development' → cache only for the dev server).

Changeset

Includes .changeset/webpack-filesystem-cache-config.md per CONTRIBUTING.

Docs

  • docs/docs/configuration.md
  • docs/docs/extra-features.md (incl. example, BuildKit cache mount note)

Test plan

  • pnpm --filter sku lint:tsc
  • pnpm lint:tsc
  • pnpm lint:eslint
  • pnpm lint:prettier
  • pnpm test (CI)

@ak-seek ak-seek requested a review from a team as a code owner April 17, 2026 00:32
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 17, 2026

🦋 Changeset detected

Latest commit: 0ee3d87

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
sku Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Allow opting in to Webpack filesystem cache for sku build / build-ssr and CI via sku.config or SKU_WEBPACK_FILESYSTEM_CACHE. Default remains development-only (dev server).

Made-with: Cursor
@ak-seek ak-seek force-pushed the add-webpack-filesystem-cache-config branch from 53fbb7e to 0ee3d87 Compare April 17, 2026 00:46
@ak-seek
Copy link
Copy Markdown
Author

ak-seek commented Apr 17, 2026

Thanks for the feedback (see here). Closing this in favour of testing the approach via dangerouslySetWebpackConfig (with BuildKit cache mounts on node_modules/.cache/webpack) in our own apps first. Once we have data showing it actually helps cold and warm builds materially, we can revisit upstreaming it.

@ak-seek ak-seek closed this Apr 17, 2026
@ak-seek ak-seek deleted the add-webpack-filesystem-cache-config branch April 17, 2026 01:29
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

Successfully merging this pull request may close these issues.

1 participant