From 58eb655881015dff06f34d248dc083fed2954b1c Mon Sep 17 00:00:00 2001 From: "Sakamoto, Kazunori" Date: Thu, 5 Oct 2023 13:14:59 +0900 Subject: [PATCH] fix(wb): set NEXT_PUBLIC_WB_ENV in start command --- packages/wb/src/commands/start.ts | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/packages/wb/src/commands/start.ts b/packages/wb/src/commands/start.ts index c65c1ec2..b6f2c70f 100644 --- a/packages/wb/src/commands/start.ts +++ b/packages/wb/src/commands/start.ts @@ -49,20 +49,17 @@ export const startCommand: CommandModule, + deps: Partial>, + env: string +): string { + process.env.WB_ENV ||= env; + let prefix = `WB_ENV=${process.env.WB_ENV} `; + if (deps['next']) { + process.env.NEXT_PUBLIC_WB_ENV = process.env.WB_ENV; + prefix += `NEXT_PUBLIC_WB_ENV=${process.env.WB_ENV} `; + } + loadEnvironmentVariables(argv, project.dirPath); + return prefix; +}