diff --git a/packages/rspack/src/utils/with-web.ts b/packages/rspack/src/utils/with-web.ts index 1d735a4d52..1a2e014aa1 100644 --- a/packages/rspack/src/utils/with-web.ts +++ b/packages/rspack/src/utils/with-web.ts @@ -117,8 +117,8 @@ export function withWeb(opts: WithWebOptions = {}) { ? path.join(context.root, options.indexHtml) : path.join(projectRoot, 'src/index.html'), }), - new rspack.DefinePlugin({ - 'process.env.NODE_ENV': isProd ? "'production'" : "'development'", + new rspack.EnvironmentPlugin({ + NODE_ENV: 'development', }), ], };