-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symlink-friendly path resolution #277
Conversation
I was having difficulties using a local copy of `react-scripts` and `npm link`ing it into a real world project. This change resolves paths relative to the current working directory (that is, most likely the directory of the app) rather than assuming a certain directory structure.
because I'm an idiot
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! |
What was the use case? You can develop Symlinks are generally hard to get right, and even if we fix something now, we might break it again in the future. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
I've been tasked with creating a React "boilerplate" for my company and this project seemed like a good starting point. But one thing we're going to need is the ability to make changes to the app locally and unblock ourselves if we run into a bug or missing feature, while it gets merged into the main repo. As a more general use case, it would allow the same workflow for the main Facebook version of this project - if somebody encountered a bug while working on their real-world project, they could I suppose another solution could be to attempt to symlink your project's source into |
appSrc: resolve('../template/src'), | ||
appNodeModules: resolve('../node_modules'), | ||
ownNodeModules: resolve('../node_modules') | ||
appBuild: resolveLib('../build'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s call this resolveOwn
.
I‘m open to merging this if it fixes the problem for you. |
Ah yes... naming things 👍 |
Released in 0.2.1. |
I was having difficulties using a local copy of
react-scripts
andnpm link
ing it into a real world project. This change resolves paths relative to the current working directory (that is, most likely the directory of the app) rather than assuming a certain directory structure.I've tested the "happy path" (that is, the use case I was trying to solve) locally and solved the problem, both by just running
npm start
andnpm run eject
ing and then running the app again. I was unable to test the other case of installing from npm - I'm actually not quite sure how to verify that. I imagine that's pretty important though, so I'd be very open to suggestions and guidance! I did runnpm test
which seems to cover a lot of cases though.