Skip to content

Commit

Permalink
fix: respect inlineConfig.mode when setting NODE_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Feb 11, 2025
1 parent 0ff964a commit b3bbdb6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/wxt/src/core/wxt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b3bbdb6

Please sign in to comment.