Fix turbo build issues with gitignored files like .hydrogen
#287
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Turbo caches inputs and matches them using a hash-based output: https://turbo.build/repo/docs/core-concepts/caching. Turbo only considers git-versioned assets as "inputs", and by default tracks
dist
andbuild
folders as "outputs." When an input hash matches the output hash, Turbo restores the dist contents to their respective folders from an internal cache and says "HEY I DON'T NEED TO BUILD! I'M ALL DONE!".However, we introduced git-ignored folders like
.hydrogen
. This means Turbo doesn't know about them, and it does not restore them properly from the internal cache. When it sees that thedev
dependencies (likehydrogen-remix#build
) are cache hits, the.hydrogen
folder is not restored — or it is not restored with the correct contents. This leads to sporadic build errors when Turbo has an active cache.This PR tells Turbo about these gitignored "output" files to ensure they are accounted for.