From 157280815727febef0ede2e4db129776aabeb07f Mon Sep 17 00:00:00 2001 From: yamachi4416 Date: Sat, 29 Nov 2025 10:27:52 +0900 Subject: [PATCH] fix(preview): respect dotenv command-line arg --- packages/nuxi/src/commands/preview.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/nuxi/src/commands/preview.ts b/packages/nuxi/src/commands/preview.ts index 1ed966d79..a2276914c 100644 --- a/packages/nuxi/src/commands/preview.ts +++ b/packages/nuxi/src/commands/preview.ts @@ -42,6 +42,10 @@ const command = defineCommand({ const resolvedOutputDir = await new Promise((res) => { loadNuxt({ cwd, + dotenv: { + cwd, + fileName: ctx.args.dotenv, + }, envName: ctx.args.envName, // c12 will fall back to NODE_ENV ready: true, overrides: {