-
-
Notifications
You must be signed in to change notification settings - Fork 757
fix: exclude hidden dir from snapshot managedPaths default value #12486
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
Conversation
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes the default value of snapshot.managedPaths to exclude hidden directories (starting with .) within node_modules from being treated as managed paths. This ensures that hidden directories like .test, .bin, and .cache are not cached across builds.
- Changed the default managedPaths regex from
/\/node_modules\//to/\/node_modules\/[^.]/ - Added comprehensive test case to verify the fix works correctly
Reviewed changes
Copilot reviewed 3 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/rspack/src/config/normalization.ts | Updated default managedPaths regex to exclude hidden directories by requiring a non-dot character after /node_modules/ |
| tests/rspack-test/cacheCases/snapshot/default_value/rspack.config.js | Added test configuration enabling persistent cache |
| tests/rspack-test/cacheCases/snapshot/default_value/index.js | Added test to verify managed paths (test_lib) are cached while hidden directories (.test) are not |
| tests/rspack-test/cacheCases/snapshot/default_value/node_modules/test_lib/* | Test fixture for regular package that should be managed |
| tests/rspack-test/cacheCases/snapshot/default_value/node_modules/.test/index.js | Test fixture for hidden directory that should not be managed |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff AnalysisFound 5 project(s) in monorepo. 📊 Quick Summary (Click to expand)
📋 Detailed Reports (Click to expand)📁 react-10kPath:
📦 Download Diff Report: react-10k Bundle Diff 📁 react-1kPath:
📦 Download Diff Report: react-1k Bundle Diff 📁 react-5kPath:
📦 Download Diff Report: react-5k Bundle Diff 📁 ui-componentsPath:
📦 Download Diff Report: ui-components Bundle Diff 📁 romePath:
📦 Download Diff Report: rome Bundle Diff Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
🙈 Size remains the same at 48.29MB |
|
Should we consider |
CodSpeed Performance ReportMerging #12486 will not alter performanceComparing Summary
|
For pnpm, the directory is usually For yarn pnp, |
Summary
Update the default managedPaths regex from //node_modules// to //node_modules/[^.]/ to exclude directories starting with a dot (e.g., .cache, .test) from being treated as managed paths in snapshot handling.
Related links
Checklist