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?
Asked
Active
Viewed 1,182 times
0
-
2https://stackoverflow.com/questions/51692588/react-js-running-npm-run-build-with-custom-paths – Brandon Kauffman Mar 03 '21 at 16:31
1 Answers
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