Pass resetCache
option to jest-haste-map
#223
Closed
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.
When the
resetCache
option is set on the bundler, it should also be passed to theDependencyGraph
andjest-haste-map
to clean up any cached files there.Summary
While trying to get
react-native-windows
working against thereact-native@0.57
RC, I ran into a series of issues because thejest-haste-map
cache was not cleaned up when the--reset-cache
flag was set on thereact-native
CLI. Not only was the option not being passed tometro
(see facebook/react-native#20706), butmetro
was not passing theresetCache
option to theDependencyGraph
andjest-haste-map
.Test plan
react-native-windows
, where the problem was occurring. I had a case where if myhasteImpl
implementation frommetro.config.js
had a bug. Even after fixing the bug, thejest-haste-map
was cached with missing haste modules. Only after deleting that file could I get back to a state where the fixedmetro.config.js
would work. After making this change, using--reset-cache
from thereact-native
CLI could clear the haste map cache.