Skip to content

Commit

Permalink
Resolves transformerPath before attempting to read contents. (#268)
Browse files Browse the repository at this point in the history
Summary:
<!-- 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**
Configuration paths are now supposed to be relative to allow them to be shared
on different paths/machines. This change makes sure that the new relative
transformerPath is require.resolved before being passed to fs.readFileSync.
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

**Test plan**
I edited node_modules directly in metro-sample-app to ensure that the fix got
me passed the unable to resolve error.
<!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. -->
Pull Request resolved: #268

Differential Revision: D10062783

Pulled By: rafeca

fbshipit-source-id: 3f4e97adf1153987c609d97e951cf3d16ea18fda
  • Loading branch information
gdborton authored and facebook-github-bot committed Sep 27, 2018
1 parent eb69699 commit 9e440d8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function getTransformCacheKey(opts: {|
VERSION,
opts.cacheVersion,
path.relative(path.join(__dirname, '../../../..'), opts.projectRoot),
getKeyFromFiles([transformerPath]),
getKeyFromFiles([require.resolve(transformerPath)]),
transformerKey,
];

Expand Down

0 comments on commit 9e440d8

Please sign in to comment.