DEV Community

Discussion on: Managing multiple environments in NestJS

Collapse
 
obsessiveo profile image
Obs

Hi, nice article very appreciated!

I have a nestjs monorepo and had to do the following for the app I am working on:

  • defining the env files as assets in 'nest-cli.json': "assets": [{"include": "../config/env/*.env", "outDir": "./config"}]
  • and change the envFilePath to ${__dirname}/config/env/${process.env.NODE_ENV}.env

In the nestjs docs, it says nestjs does not move assets automatically to the dist folder. Maybe that is the reason.

Cheers