Create .env file
How can i create .env file i read the docs and according to it .env should be exist in nuxt installation but i cant find it and i tried to use this command
and it open dev server not create a new .env file
2 Replies
You have to setup a .env file in your homefolder by yourself. It will then be used. You only have to use
--dotenv .env.local
in case you want to user any filename but .env
I'd recommend just using a single .env file per environment rather than trying to chain them or run a specific file for dev or prod. It'll reduce confusion and the likelyhood of something being overwritten improperly if you just use
.env
.
As part of your deploy process you can copy .env.production
to .env
for example
.env
should also be excluded from your version control so that you always have to get the correct version for your correct environment when you're deploying