Open shellyear opened 5 months ago
Seems like you are not returning config.js
but index.html (i.e. config.js
is search in different path)
Seems like you are not returning
config.js
but index.html (i.e.config.js
is search in different path)
Yes, the build(production) and dev need the "base" property in vite.config.js to be default "/", but the build for the dockerization should have "base" property as "/record-manager/", because of how it's set in docker-compose.
@blcham Vite serves the app from the root path (/) by default for the dev and production (base: '/' in vite.config.js) . When build for production, Vite generates the assets with paths relative to the specified base. The docker-compose.yml > record-manager > environment has a BASENAME custom environment variable which will be then used in config.js.template in .docker folder and written to config.js and then the BASENAME variable will be used in the source code for the react-router as it's property in App.js. The base in vite.config.js and in the BASENAME should match https://v5.reactrouter.com/web/api/BrowserRouter/basename-string
Current state: works on dev, prod and dockerization
Current state: works on dev, prod and dockerization
I did not test the dockerization, but I have doubts about the solution. I have questions: 1) do setting BASENAME really work in runtime? I.e. i should be possible to do only the following steps:
docker-compose up
it should work on http://localhost:1235/record-manager
docker-compose up
it should work on http://localhost:1235/record-manager-super-demo
@blcham solving https://github.com/kbss-cvut/record-manager-ui/issues/125
It works with dev and build. But not in the dockerization, working on it