How to get relative paths in auto-generated index.html when using npm start #12254
Replies: 3 comments
-
I read it wasn't possible back in 2019. Does anyone know if this has been fixed? |
Beta Was this translation helpful? Give feedback.
-
I have managed to make it generate |
Beta Was this translation helpful? Give feedback.
-
I ended up setting a proxy. Some context first: So, the overall configuration that got it working is the following:
Now we got
now we achieve this: Now the problem seems to be the websocket but at least the app is accessible. |
Beta Was this translation helpful? Give feedback.
-
Hi, I am wondering how to get the generated index.html to have relative paths rather than absolute paths when running
npm start
. I need the development environment to be able to be accessed through a proxy so that an url like https://domain.domain/whatever goes to myserver:3000, where the app is running.Using the default configuration,
npm start
serves anindex.html
withwhich results in wrong paths as the browser tries to retrieve bundle.js from https://domain.domain/static/js/bundle.js.
I found this and tried setting
"start_url"
in the manifest and"homepage":"."
in package.json but it does not work. Curious enough, If I set something like"homepage":"whatever.com/whatever"
it somehow takes it into account but still generates an absolute path:Thanks ahead for any help!
Beta Was this translation helpful? Give feedback.
All reactions