Skip to content

fix: skip node_modules/.vite-temp/ from fspy tracking#287

Open
fengmk2 wants to merge 2 commits intomainfrom
fix/skip-vite-temp-from-fspy-tracking
Open

fix: skip node_modules/.vite-temp/ from fspy tracking#287
fengmk2 wants to merge 2 commits intomainfrom
fix/skip-vite-temp-from-fspy-tracking

Conversation

@fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Mar 22, 2026

Summary

  • Exclude node_modules/.vite-temp/ paths from fspy file access tracking
  • Add e2e tests verifying cache behavior with .vite-temp writes

Vite writes transient compiled config files to node_modules/.vite-temp/ during builds. These files are both read and written by the build process, causing fspy to detect a read-write overlap that prevents caching ("not cached because it modified its input").

This adds a hardcoded exclusion for node_modules/.vite-temp/ in the fspy path filtering, similar to the existing .git directory exclusion.

Test plan

  • E2E test cache-skip-vite-temp: verifies second run hits cache despite .vite-temp write
  • E2E test cache-skip-vite-temp: verifies real source changes still cause cache miss
  • Existing cache-related e2e tests pass (cache-miss-reasons, input-cache-test, cache-disabled)

Closes voidzero-dev/vite-plus#1095

🤖 Generated with Claude Code

Vite writes transient compiled config files to node_modules/.vite-temp/
during builds. These files are both read and written by the build process,
causing fspy to detect a read-write overlap that prevents caching with
"not cached because it modified its input".

Exclude node_modules/.vite-temp/ paths from fspy tracking, similar to the
existing .git exclusion. These are ephemeral build artifacts that should
never affect cache correctness.

Closes voidzero-dev/vite-plus#1095
}

// Skip Vite temp config files (transient build artifacts)
if relative.as_str().contains("node_modules/.vite-temp/") {
Copy link
Member Author

Choose a reason for hiding this comment

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

Writing hardcode rules here in vite-task doesn't look good. It makes sense that this global configuration should be passed in vite-plus

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.

Cache miss on repeated pack builds: task modifies its own input

1 participant