From 4a25576b657e3a551e4125e896cddbaf7cb7d723 Mon Sep 17 00:00:00 2001 From: Craigory Coppola Date: Mon, 21 Aug 2023 13:42:51 -0400 Subject: [PATCH] fix(core): load .env after .env.local (#18746) --- packages/nx/bin/nx.ts | 2 +- packages/nx/src/tasks-runner/forked-process-task-runner.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nx/bin/nx.ts b/packages/nx/bin/nx.ts index 788fc966680f8..6851730d816cf 100644 --- a/packages/nx/bin/nx.ts +++ b/packages/nx/bin/nx.ts @@ -108,7 +108,7 @@ function main() { * - .env.local */ function loadDotEnvFiles() { - for (const file of ['.env', '.local.env', '.env.local']) { + for (const file of ['.local.env', '.env.local', '.env']) { loadDotEnvFile({ path: file, }); diff --git a/packages/nx/src/tasks-runner/forked-process-task-runner.ts b/packages/nx/src/tasks-runner/forked-process-task-runner.ts index d29db90ffe70b..f91a0631fe790 100644 --- a/packages/nx/src/tasks-runner/forked-process-task-runner.ts +++ b/packages/nx/src/tasks-runner/forked-process-task-runner.ts @@ -437,9 +437,9 @@ export class ForkedProcessTaskRunner { `.${task.target.target}.env`, // Load base DotEnv Files at workspace root - `.env`, `.local.env`, `.env.local`, + `.env`, ]; for (const file of dotEnvFiles) {