From 1a13013b45a1ac818a40d4cc9c762a6c7429fc5c Mon Sep 17 00:00:00 2001 From: Dmytro Stanchiev Date: Tue, 19 Aug 2025 01:53:27 -0400 Subject: [PATCH] use different env files based on node env --- drizzle.config.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drizzle.config.ts b/drizzle.config.ts index 7502c55..433f699 100644 --- a/drizzle.config.ts +++ b/drizzle.config.ts @@ -1,7 +1,11 @@ import { defineConfig } from 'drizzle-kit'; import * as dotenv from 'dotenv'; -dotenv.config({ path: '.env.local' }); +if (process.env.NODE_ENV === "production") { + dotenv.config({ path: '.env.production' }); +} else { + dotenv.config({ path: '.env.local' }); +} export default defineConfig({ dialect: 'postgresql', @@ -12,4 +16,4 @@ export default defineConfig({ }, verbose: true, strict: true, -}); \ No newline at end of file +});