Skip to content

Commit 655ba86

Browse files
authored
fix: respect inlineConfig.mode when setting NODE_ENV (#1416)
1 parent ac92d40 commit 655ba86

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/wxt/src/core/wxt.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export async function registerWxt(
2121
): Promise<void> {
2222
// Default NODE_ENV environment variable before other packages, like vite, do it
2323
// See https://github.com/wxt-dev/wxt/issues/873#issuecomment-2254555523
24-
process.env.NODE_ENV ??= command === 'serve' ? 'development' : 'production';
24+
process.env.NODE_ENV ??=
25+
inlineConfig.mode ?? (command === 'serve' ? 'development' : 'production');
2526

2627
const hooks = createHooks<WxtHooks>();
2728
const config = await resolveConfig(inlineConfig, command);

0 commit comments

Comments
 (0)