mirror of
https://github.com/status-im/metro.git
synced 2025-01-13 04:24:15 +00:00
233b00e836
Summary: The traverse dependencies logic was using the absolute path of the resolved dependency to group the module dependencies, so for example if there's a module like: ``` const a = require('./a'); const a1 = require('./a.js'); ``` The traversal dependencies logic was just outputting a single dependency for that module. Since we're transforming each `require()` call to replace the relative path by a dependencyMap, the code from above was transformed to: ``` const a = require(_dependencyMap[0]); const a1 = require(_dependencyMap[1]); ``` But since the traverse dependencies logic could only find a single dependency, `_dependencyMap[1]` was undefined, causing a runtime error. This fixes https://github.com/facebook/metro/issues/152 (more info in the task) Reviewed By: jeanlauliac Differential Revision: D7258093 fbshipit-source-id: 65c42b87e589430ecc96b906230dd7c4c55c2146