So when you run npm run start command, all .env.dev environment variables will be available through process.env.some_key and when you run npm run start-prod command, all .env.prod environment variables will be available through process.env.some_key only.
There is no need of activating .env file. For .env.prod you can use the env-cmd npm package and use it as shown below:
So when you run
npm run start
command, all .env.dev environment variables will be available through process.env.some_key and when you runnpm run start-prod
command, all .env.prod environment variables will be available through process.env.some_key only.ok you left one point , please answer that too
i have asked, that if i have .env.dev file
and i have some key as
then how do i need to use it?
Do i need to use it as
or
you need to use process.env.SOME_KEY only. Also don't add spaces before and after the
=
sign in .env fileokay thankyou sir, i will definitely try this
so,
and importing it as
I think this is fine now
Yes, it looks fine