question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parameter "homepage" in package.json

See original GitHub issue

Hi,

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:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Johnny-jobercommented, Dec 20, 2017

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,

2reactions
Timercommented, Feb 11, 2017

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found