Skip to content

fix(cache): buildCache.cacheDirectory config not work#4790

Merged
chenjiahan merged 5 commits intoweb-infra-dev:mainfrom
Shucei:shucei
Mar 14, 2025
Merged

fix(cache): buildCache.cacheDirectory config not work#4790
chenjiahan merged 5 commits intoweb-infra-dev:mainfrom
Shucei:shucei

Conversation

@Shucei
Copy link
Contributor

@Shucei Shucei commented Mar 14, 2025

Summary

Fix: Rspack cache directory config not taking effect due to incorrect config structure

When configuring performance.buildCache.cacheDirectory in Rsbuild, the cache directory setting was not being applied correctly for Rspack. This is because Rspack requires the cache directory to be configured under experiments.cache.storage.directory, while the current implementation was placing it directly under experiments.cache.directory.

Before:

chain.experiments({
  cache: {
    type: 'persistent',
    directory: cacheDirectory, // ❌ incorrect placement
    buildDependencies,
    version: cacheVersion
  }
});

## Related Links
Rspack cache configuration documentation: https://rspack.dev/config/cache

<!--- Provide links of related issues or pages -->

## Checklist
Updated the cache directory configuration structure in packages/core/src/plugins/cache.ts

<!--- Check and mark with an "x" -->

- [ ] Tests updated (or not required).
- [ ] Documentation updated (or not required).

@CLAassistant
Copy link

CLAassistant commented Mar 14, 2025

CLA assistant check
All committers have signed the CLA.

@netlify
Copy link

netlify bot commented Mar 14, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 1109663
🔍 Latest deploy log https://app.netlify.com/sites/rsbuild/deploys/67d3efc237391700084ee43f
😎 Deploy Preview https://deploy-preview-4790--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 73 (🔴 down 2 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@chenjiahan chenjiahan changed the title fix(plugins):fixed the cache path configuration fix(cache): buildCache. cacheDirectory config not work Mar 14, 2025
@chenjiahan chenjiahan changed the title fix(cache): buildCache. cacheDirectory config not work fix(cache): buildCache.cacheDirectory config not work Mar 14, 2025
chenjiahan
chenjiahan previously approved these changes Mar 14, 2025
Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@chenjiahan chenjiahan merged commit 7202a63 into web-infra-dev:main Mar 14, 2025
11 checks passed
@chenjiahan chenjiahan mentioned this pull request Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants