I'm creating an SSR React app, I'm using babel-node
for server and webpack for client. I'm facing sharing/accessing env variables. For client (webpack), I use webpack.DefinePlugin
and access .env
with fetch(
${API_V1}/get-product), Without
process.env`
But not able to do the same on babel-node
. I don't want to update all the files with process.env.API_V1
and just want to access envs like API_V1.
Is there any plugin or method to achieve this?
Thanks in advance.
More Info
ReferenceError: WEB_URL is not defined