Parameter "homepage" in package.json
See original GitHub issueHi,
I miss an explanation at the documentation about the parameter “homepage” in package.json, and it is very useful for making buildings.
For instance, I had a problem because the index.html file pointed to “/static/js/…js” and that’s is correct if we release the application in the root folder, but if you have various static developments in the same machine using the same Apache Server you have a problem.
I configured package.json with:
"homepage": "."
That made that instead of using absolute paths we use relative paths in the current folder. What I mean: “./static/js/…js”
I think that this information will be useful to other developers.
Thanks a lot for your work!!!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Using `"homepage"` in package.json, without messing up ...
I added a "homepage" to my package.json because it is a React app that I hosted on Github Pages. The output of npm...
Read more >Deployment
Step 1: Add homepage to package.json . The step below is important! If you skip it, your app will not deploy correctly. Open...
Read more >package.json
The name ends up being part of a URL, an argument on the command line, and a folder name. ... Example: "homepage": "https://github.com/owner/project#readme" ......
Read more >Create React App: A quick setup guide
You only have to execute npm install with the flags — — save — -save-exact to specify the exact version. The package.json will...
Read more >Using `"homepage"` in package.json, without messing up ...
Add package.json['homepage'] to be your production url. To be noted, the CRA build step removes the domain part of the url to leave...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello @Timer Thanks a lot for your this ‘relative path’ contribution. I have a problem with my specific use case.
To generalize my question, I have set up the environment using express-generator and I created CRA inside public folder, named as ‘client’ just in case if you could see the entire source, it is HERE
I would desperately want to use client side routing (react-router v4) and hopefully also Redux in the future… Could you please take a look when you get a chance please?
Very much appreciated,
Hi there!
react-scripts
v0.9.0 was just released which adds support for building for relative paths. You may read how to do so here.Please test it and don’t hesitate to reach out if this doesn’t solve your specific use case!