I discovered today the use of environment variables in React, and I love it ! Especially using react-router, and filling up the basename attribute of the <BrowserRouter> component this way :
<BrowserRouter basename={`${process.env.REACT_APP_BASENAME}`}>
</BrowserRouter>
It's great, but I would like to use the variable REACT_APP_BASENAME also in package.json file, because as you know, the "homepage" line in package.json define the PUBLIC_URL variable used in index.html as %PUBLIC_URL%, and I would like this PUBLIC_URL to be equal to my REACT_APP_BASENAME variable. I think I would need something like that :
package.json :
{
"name": "apoc",
"version": "0.1.0",
"private": true,
"homepage": "%REACT_APP_BASENAME%",
"dependencies": {....
Is it possible ?