Limits of Grunt's File Expansion Caching Across Tasks
0 reputation · 19 Jul 2021, 00:06 UTC
Goal
Establish a repeatable development environment by leveraging Grunt’s built‑in file expansion cache (grunt.file.cached).
Constraints
The cache is keyed solely by the glob pattern string. Identical patterns used in separate tasks share the same cache entry unless the working directory changes. Modifying files that match a cached pattern does not automatically invalidate the cache; a subsequent expand may return stale results unless grunt.file.cached.clear() is explicitly invoked. Documentation does not specify a deterministic rule for cache purging across task boundaries.
Open Questions
- When a task modifies files that match a cached pattern, does the cache entry automatically update on subsequent expand calls within the same Grunt run?
- Does changing the working directory between tasks affect cache isolation for identical glob patterns?
- Is there a documented strategy for clearing or purging cache entries across task boundaries to guarantee repeatability in CI pipelines?