-
-
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
Is there any way to set homepage outside of package.json? #1435
Comments
This is not currently supported. Why would they get conflicts though? If it’s a single line change they should be able to merge any other changes without conflicts (unless you will change your URL again). |
I guess I mean if they intend to merge updates back into my repo then they have to revert their homepage change, get it merged into mine, then change their homepage back. If all changes are from me to them then yeah there's no issue but if they're proposing changes in my direction hopefully you see where I'm coming from. |
Why do you need to change the homepage for development? I think homepage is for production build. Don't see why it should / would be changed with every developer who collaborating because we serve the development build on localhost:3000 or anything based on your current HOST and PORT env variable |
In our case we are deploying to github pages outside of an organization, so it doesn't make sense for my bud's repo to deploy to my pages. I understand that it obviously fits in an organization type setup where there's a clear, single I understand if you don't see my use case as worth supporting, or if you want to say we should have a more typical workflow. There are certainly workarounds to it as well, we can always just swap the homepage back on branches that are agreed to be merged. I just thought there's probably a way to do it that's less hacky (or doesn't require ejecting) but clearly you can just propose that create-react-app isn't meant to be super flexible, it's meant to have sensible defaults. |
I'm looking for a similar capability for a different use case: in our "versioned" production environment, the homepage value requires a version number appended to the end of it. E.g.: "/extensions/myapp-1.2.3" for a React app named "myapp". I would like a method to set this value either from a file (like .env) or from an environment variable. [Additional details: my React apps are essentially controlled "plug-ins" that are loaded via a dynamically generated <iframe src="/extensions/myapp-1.2.3/index.html"> in the main app. We are currently doing this "the hard way" - loading babel.js, react.js, etc. and transpiling in the browser, which has many performance and functionality limitations such as difficulty using any 3rd-party react/js libraries. I would like to switch to CRA-based development, but I'm having issues merging this into our build and deployment processes. I am also looking for the same capability for the package.json "version" variable, but that may be a topic for a different discussion...] |
I think #937 might solve this. |
Hi there! Please test it and don't hesitate to reach out if this doesn't solve your specific use case! |
I'm not familiar enough with npm or any part of the build to be certain that there isn't a way to already, but I can't find documentation for it if it is possible.
Basically, I want to be able to configure homepage in a file not under source control (or passed as a cli argument or environment variable or what have you) so that if somebody forks the project they aren't needing to use my homepage and aren't getting conflicts if they're keeping up with active development.
Thanks!
The text was updated successfully, but these errors were encountered: