diff --git a/config/paths.js b/config/paths.js index 9fbb4ecbc56d885db4e6c9364c935f8bb7e8513e..bb1ba7612586d50fd3c5f47cf5f320cc2576a249 100644 --- a/config/paths.js +++ b/config/paths.js @@ -10,6 +10,14 @@ // @remove-on-eject-end var path = require('path'); +var fs = require('fs'); + +// Make sure any symlinks in the project folder are resolved: +// https://github.com/facebookincubator/create-react-app/issues/637 +var appDirectory = fs.realpathSync(process.cwd()); +function resolveApp(relativePath) { + return path.resolve(appDirectory, relativePath); +} // We support resolving modules according to `NODE_PATH`. // This lets you use absolute paths in imports inside large monorepos: @@ -25,11 +33,7 @@ var path = require('path'); var nodePaths = (process.env.NODE_PATH || '') .split(process.platform === 'win32' ? ';' : ':') .filter(Boolean) - .map(p => path.resolve(p)); - -function resolveApp(relativePath) { - return path.resolve(relativePath); -} + .map(resolveApp); // config after eject: we're in ./config/ module.exports = {