Record "requiredFiles" in babel result, for cache key purposes #1401
Labels
feature: proposal 💬
New feature proposal that needs to be discussed
needs: triage 🏷
Issue needs to be checked and prioritized
Describe the feature
Add "requiredFiles" to the babel result, that lists the file paths + hashes of each file that gets used in static evaluation.
Motivation
Something we've done and found useful is recording the files that get required during static evaluation in the babel result (the paths, and the sha1 of each file). This is useful as it lets us cache the result of transforms, and know when to bust this cache too. We're using metro as our build system, which has a per-file cache for transformations. This means that a file like this:
that we need to bust the cache if the
constant
changes.Possible implementations
We figured this out on the version of linaria we're on, in
module.ts
(at least in the version we're on, I'm sure this is possible in the latest linaria, too)Related Issues
The text was updated successfully, but these errors were encountered: