Skip to content

Option to stop inheritance of cache keys from dependencies #237

Description

@aomarks

Currently the cache key for a script (which affects whether it can be skipped or restored-from-cache) automatically includes the transitive cache keys of all of its dependencies. That means if A depends on B, then if an input to B changes, then both B and A will re-run -- regardless of whether B produces any new or relevant output.

This is a safe and good default because it doesn't require you to specify your input files, which means you can start seeing benefits sooner, and makes it harder to create an invalid config at first.

The downside is that you sometimes get unnecessary builds, because sometimes a dependency runs, but doesn't produce new output -- or doesn't produce new output that you actually care about. For example, a change to a .ts file might only cause changes to d.ts files, which Rollup can typically ignore. Or a change to a tsconfig.json type-checking rule might not produce any different output at all.

We should add a way to annotate that a particular dependency edge doesn't inherit the cache key.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status
✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions