:wave: Is there a way to specify different `.env` ...
# orm-help
l
👋 Is there a way to specify different
.env
files when running
yarn dev
using one of the Prisma GraphQL server boilerplates? I'm following the recommended workflow of separating my environments with
.env
files and using variables in the
prisma.yml
file. This works great when running
prisma deploy
with a
--env-file
flag. However, running
yarn dev
will only read from a
.env
file - is there a way to change this?
m
@lewisblackwood
Copy code
"local-start": "dotenv -e config/dev.env -- nodemon -e ts,graphql -x ts-node src/index.ts",
    "local-prod-start": "dotenv -e config/prod.env -- nodemon -e ts,graphql -x ts-node src/index.ts",
    "dev": "npm-run-all --parallel local-start playground",
use dotenv
with -e option
l
Thanks! I found the handy
dotenv_config_path
flag for the dotenv preloader, so now I can do:
nodemon -e js,graphql -x node -r dotenv/config src/index.js dotenv_config_path=.env.dev
👍 1