diff --git a/packages/wxt/src/core/wxt.ts b/packages/wxt/src/core/wxt.ts index 2c616b75..eafc9429 100644 --- a/packages/wxt/src/core/wxt.ts +++ b/packages/wxt/src/core/wxt.ts @@ -21,7 +21,8 @@ export async function registerWxt( ): Promise { // Default NODE_ENV environment variable before other packages, like vite, do it // See https://github.com/wxt-dev/wxt/issues/873#issuecomment-2254555523 - process.env.NODE_ENV ??= command === 'serve' ? 'development' : 'production'; + process.env.NODE_ENV ??= + inlineConfig.mode ?? (command === 'serve' ? 'development' : 'production'); const hooks = createHooks(); const config = await resolveConfig(inlineConfig, command);