I am working on a project built with create-react-app using two homepage url (staging and production). To avoid the need to change homepage in package.json manually before deployment to staging or production, I tried to set a PUBLIC_URL environment variable in both my .env and .env.production files and I deleted homepage in package.json.
PUBLIC_URL=https://xxxxx.io/new-manager-staging
After reading the doc, I assumed it would set the homepage url during build time, but it does not seem to be the case.
Is there an other place to set PUBLIC_URL or an other way to have multiple homepages or to set homepage dynamically in package.json? Thanks in advance!
dotenv npm moduleand then you would read likeprocess.env.PUBLIC_URLassuming in your .env file you have a variable with PUBLIC_URL