Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Don't use app node_modules folder as a resolve fallback #3884

Merged
merged 1 commit into from
Jan 21, 2018

Conversation

gaearon
Copy link
Contributor

@gaearon gaearon commented Jan 21, 2018

This behavior was originally introduced in #1359 as we thought it would fix the npm link development workflow issues.

However, we have since found several problems with it:

There are also gotchas like webpack/webpack#985 (comment), and I feel like it’s only going to get worse once we start supporting monorepos (#3741).

I propose that we completely disable this behavior for now. People who really need it can use an escape hatch: add NODE_PATH=node_modules to their .env file. This restores the 1.x behavior (and conveniently works in Jest too).

Our recommendation in any case will be to use monorepos instead (#3741) and stop relying on npm link.

@gaearon
Copy link
Contributor Author

gaearon commented Jan 21, 2018

cc @bradfordlemley

@gaearon gaearon added this to the 2.0.0 milestone Jan 21, 2018
Copy link
Contributor

@Timer Timer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a separate PR, I think we should normalize the path delimiter for macOS & Windows support.

Many people commit their .env files and I see this becoming commonplace:
NODE_PATH=src;node_modules

@gaearon gaearon merged commit 1cf2248 into facebook:next Jan 21, 2018
akstuhl pushed a commit to akstuhl/create-react-app that referenced this pull request Mar 15, 2018
zmitry pushed a commit to zmitry/create-react-app that referenced this pull request Sep 30, 2018
@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants