Presently building my create-react-app build generates references to assets as absolute paths ie:
/static/js/main.12345.js
I want to serve from a variable subdirectory which could be:
/pre-prod or /prod
So setting "homepage" in package.json will not work as the homepage is dependent on the runtime environment.
I'd like to generate the asset references like so:
static/js/main.12345.js
And I'd prefer to do it without ejecting. Is that possible? I have looked at the docs and googled etc and do not see an answer.
Presently building my create-react-app build generates references to assets as absolute paths ie:
/static/js/main.12345.js
I want to serve from a variable subdirectory which could be:
/pre-prod or /prod
So setting "homepage" in package.json will not work as the homepage is dependent on the runtime environment.
I'd like to generate the asset references like so:
static/js/main.12345.js
And I'd prefer to do it without ejecting. Is that possible? I have looked at the docs and googled etc and do not see an answer.
Share Improve this question asked Jul 26, 2018 at 22:33 HelloWorldHelloWorld 2,3303 gold badges31 silver badges47 bronze badges1 Answer
Reset to default 10Have you tried setting the "homepage"
in package.json to "."
? That's what I do.