Navigation Menu

Skip to content

Commit

Permalink
fix(react): fix conflicting NODE_ENV values between an application an…
Browse files Browse the repository at this point in the history
…d webpack Plugins (DefinePlugin) (#9460)

ISSUES CLOSED: #7924

Co-authored-by: Nicholas Cunningham <ndcunningham>
  • Loading branch information
ndcunningham authored and FrozenPandaz committed Mar 25, 2022
1 parent f18163a commit 01f7e00
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/web/src/executors/webpack/webpack.impl.ts
Expand Up @@ -143,7 +143,14 @@ export async function* run(
);
}

process.env.NODE_ENV ||= 'production';
const isScriptOptimizeOn =
typeof options.optimization === 'boolean'
? options.optimization
: options.optimization && options.optimization.scripts
? options.optimization.scripts
: false;

process.env.NODE_ENV ||= isScriptOptimizeOn ? 'production' : 'development';

const metadata = context.workspace.projects[context.projectName];

Expand Down

0 comments on commit 01f7e00

Please sign in to comment.