You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
When the `resetCache` option is set on the bundler, it should also be passed to the `DependencyGraph` and `jest-haste-map` to clean up any cached files there.
<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. -->
**Summary**
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->
While trying to get `react-native-windows` working against the `[email protected]` RC, I ran into a series of issues because the `jest-haste-map` cache was not cleaned up when the `--reset-cache` flag was set on the `react-native` CLI. Not only was the option not being passed to `metro` (see facebook/react-native#20706), but `metro` was not passing the `resetCache` option to the `DependencyGraph` and `jest-haste-map`.
**Test plan**
<!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. -->
1. yarn test
2. Validated in `react-native-windows`, where the problem was occurring. I had a case where if my `hasteImpl` implementation from `metro.config.js` had a bug. Even after fixing the bug, the `jest-haste-map` was cached with missing haste modules. Only after deleting that file could I get back to a state where the fixed `metro.config.js` would work. After making this change, using `--reset-cache` from the `react-native` CLI could clear the haste map cache.
Pull Request resolved: #223
Differential Revision: D9377632
Pulled By: rafeca
fbshipit-source-id: e67b5eeb84937daedc7e9f7b5a7d93e11e0d7edb
0 commit comments