From 2d8a48d6074a8336aa19c25c193976703a2db942 Mon Sep 17 00:00:00 2001 From: shni Date: Sat, 4 Oct 2025 18:17:38 -0500 Subject: [PATCH] feat(env): conditionally load .env file for Node.js 20.6+; remove dotenv dependency --- package-lock.json | 1 - package.json | 1 - src/main.ts | 5 ++++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6967330..802c44c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,6 @@ "chrono-node": "2.9.0", "discord-api-types": "0.38.26", "discord.js": "15.0.0-dev.1759363313-f510b5ffa", - "dotenv": "16.6.1", "node-appwrite": "19.1.0", "pino": "9.13.0", "prisma": "6.16.2", diff --git a/package.json b/package.json index 438139c..2c08830 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,6 @@ "chrono-node": "2.9.0", "discord-api-types": "0.38.26", "discord.js": "15.0.0-dev.1759363313-f510b5ffa", - "dotenv": "16.6.1", "node-appwrite": "19.1.0", "pino": "9.13.0", "prisma": "6.16.2", diff --git a/src/main.ts b/src/main.ts index 3cf6e63..85f4cfc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,7 @@ -import "dotenv/config"; +// Cargar .env localmente solo si Node soporta process.loadEnvFile (Node.js 20.6+) +if (typeof (process as any).loadEnvFile === 'function') { + (process as any).loadEnvFile(); +} import Amayo from "./core/client"; import { loadCommands } from "./core/loaders/loader";