Description
My requirements are:
1.) to build the create-react-app in Docker in the build phase of the pipeline
2.) to dynamically pass in environment variables on deployment at run-time
3.) to change the PUBLIC_URL in the release phase in order to host the app in a sub-directory
I've got 1.) and 2.) working. I'm just really struggling with 3.)
I'm struggling to see how it's at all possible to host the app at a sub-directory with the above (not unreasonable in my opinion) requirements. (i.e. host at test.com/subfolder.)
I'm fully clued up on the nuances of using 'homepage' and 'process.env.PUBLIC_URL' and '%PUBLIC_URL' and where to use them etc.
However, since all the compilation magic and chunking happens in the build stage, which would need to stick the '/subfolder' prefix in every relevant place in the index.html and other files in the build folder, is this even possible considering I'm trying to only build once and then deploy dynamically multiple times?
Been struggling with this for a while now so any input on the matter would be much appreciated!