support PUBLIC_URL during development as well
Created by: PavelPolyakov
Is this a bug report?
no
Situation
Imagine I want to have the next product structure:
- SPA (created using
create-react-app), which is going to be served as/auth - API, which is going to be served as
/auth/api/* - gateway, which resolves all the requests to the appropriate microservices
Here is a demo repo I prepared.
Problem
In the current version of CRA the variable PUBLIC_URL is ignored during the development.
The closest answer to the question why? which I found was this:
https://github.com/facebook/create-react-app/commit/30ee52cf3b2cbb6ac70999c02b1196bcaba8d4ca#diff-a7f98c18479be87c9f33e7604dbd1a09L33
which was updated by https://github.com/facebook/create-react-app/commit/30ee52cf3b2cbb6ac70999c02b1196bcaba8d4ca#diff-dc0c4e7c623b73660da1809fc60cf6baR74 (@Timer)
But this is exactly what prevents people from developing CRA applications while being under the gateway. I think it is quite handy in the "microservices" world.
Question
Are there any solutions to this problem? Is this something we can change in the CRA behaviour?
Regards,