DEV Community

Discussion on: How to share envs in a monorepo with vite and nextjs apps

Collapse
 
treipatru profile image
Andrei • Edited

Just use the dotenv-cli NPM package. Add it to your workspace then prepend dotenv to any script and it will have access to your root env file at runtime.
Works cross-platform too and you don't have to maintain another script if you prefer a dependency over that.

Collapse
 
tgmarinhodev profile image
Thiago Marinho

thank you for sharing!