Skip to content

Commit 19e2490

Browse files
committed
Find react-scripts even when hoisted
1 parent 2dec991 commit 19e2490

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/react-scripts/config/paths.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
const path = require('path');
1212
const fs = require('fs');
1313
const url = require('url');
14+
const findUp = require('find-up');
1415

1516
// Make sure any symlinks in the project folder are resolved:
1617
// https://github.com/facebook/create-react-app/issues/637
@@ -122,7 +123,9 @@ module.exports = {
122123
};
123124

124125
const ownPackageJson = require('../package.json');
125-
const reactScriptsPath = resolveApp(`node_modules/${ownPackageJson.name}`);
126+
const reactScriptsPath = findUp.sync(`node_modules/${ownPackageJson.name}`, {
127+
cwd: resolveApp('.'),
128+
});
126129
const reactScriptsLinked =
127130
fs.existsSync(reactScriptsPath) &&
128131
fs.lstatSync(reactScriptsPath).isSymbolicLink();

0 commit comments

Comments
 (0)