fix: respect inlineConfig.mode when setting NODE_ENV (#1416)

This commit is contained in:
Alec Larson
2025-02-12 00:44:29 -05:00
committed by GitHub
parent ac92d4019f
commit 655ba863a0
+2 -1
View File
@@ -21,7 +21,8 @@ export async function registerWxt(
): Promise<void> {
// 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<WxtHooks>();
const config = await resolveConfig(inlineConfig, command);