Skip to content

How to appropriately handle prod/dev environment variables #2310

Answered by ryands17
powderham asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @powderham 👋
One workaround would be to use sometihing like dotenv-cli and pass a custom .env file while running the command.

So it would look something like this:

dotenv -e env.prod -- next build --prod

Do let me know if it works.
There is also an open issue here

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by powderham
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants