0

When we create a reactjs project with the npm run build command, links to the "static" folder are created with a / before. Example: src = "/static/css...". When we are going to host on a domain... https://dominio.com/app. We have to update all links by removing the / or placing the static folder inside the root of the domain. How can we specify the root directory for /app/static when creating the project with the npm run build command?

1 Answers1

0

You can specify homepage in your package.json

  "homepage": "http://mywebsite.com/app",

Here is Create React APP docs reference

Yaroslav Bigus
  • 678
  • 7
  • 24