Drop workspace from metro lookup

Summary: Fix the path lookup for metro root.

Reviewed By: mjesun

Differential Revision: D7685280

fbshipit-source-id: 8d506bbf9c5af297d4050d2fa73475fd280bb186
This commit is contained in:
Peter van der Zee 2018-04-19 09:09:10 -07:00 committed by Facebook Github Bot
parent da57ae740d
commit 8642356367
1 changed files with 2 additions and 2 deletions

View File

@ -23,8 +23,8 @@ function buildRegExps(basePath, dirPaths) {
folderPath =>
folderPath === 'metro'
// metro uses flow (for example) which needs to be stripped out w/babel.
// it'll resolve to .../metro/packages/metro/src/index.js we want root
? path.resolve(require.resolve('metro'), '..', '..', '..', '..')
// it'll resolve to .../metro/src/index.js we want root
? path.resolve(require.resolve('metro'), '..')
// Babel `only` option works with forward slashes in the RegExp so replace
// backslashes for Windows.
: folderPath instanceof RegExp