You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am developing an app which I am deploying from a subdirectory.
In my package.json I have included "homepage": "https://example.com/my-subdirectory" and everything works great for deployment.
The only problem is when developing, my public folder assets get served from http://localhost:3000/ and not http://localhost:3000/my-subdirectory/.
Because I am using react-router and also doing some fetching and reading from resources in the public directory I do need to use the sub-directory in the urls, and so I need to modify some of my code while developing, and then again when deploying.
It would be wonderful if the public assets could be served from http://localhost:3000/subdirectory/ when there is "homepage": "https://example.com/subdirectory" in package.json.
The text was updated successfully, but these errors were encountered:
We're adding this in the future, for now you can prefix your assets with process.env.PUBLIC_URL, e.g. <img src={process.env.PUBLIC_URL + '/my-thing.jpg'} />.
I am developing an app which I am deploying from a subdirectory.
In my
package.json
I have included"homepage": "https://example.com/my-subdirectory"
and everything works great for deployment.The only problem is when developing, my public folder assets get served from
http://localhost:3000/
and nothttp://localhost:3000/my-subdirectory/
.Because I am using react-router and also doing some fetching and reading from resources in the public directory I do need to use the sub-directory in the urls, and so I need to modify some of my code while developing, and then again when deploying.
It would be wonderful if the public assets could be served from
http://localhost:3000/subdirectory/
when there is"homepage": "https://example.com/subdirectory"
inpackage.json
.The text was updated successfully, but these errors were encountered: