diff --git a/cases/10000/rspack.config.js b/cases/10000/rspack.config.js index 6659fbb2..7ec6e381 100644 --- a/cases/10000/rspack.config.js +++ b/cases/10000/rspack.config.js @@ -13,8 +13,8 @@ module.exports = { new rspack.HtmlRspackPlugin({ template: path.resolve(__dirname, "./index.html") }), - new ReactRefreshPlugin() - ], + !prod && new ReactRefreshPlugin() + ].filter(Boolean), module: { rules: [ { diff --git a/lib/addons/development-mode.js b/lib/addons/development-mode.js index c8825c34..57c81623 100644 --- a/lib/addons/development-mode.js +++ b/lib/addons/development-mode.js @@ -2,6 +2,7 @@ import { Addon } from "./common.js"; export default class extends Addon { async afterSetup(ctx) { + process.env.NODE_ENV = "development"; ctx.rspackArgs.push("build", "--mode", "development"); } } diff --git a/lib/addons/production-mode.js b/lib/addons/production-mode.js index a977cf0f..77163a15 100644 --- a/lib/addons/production-mode.js +++ b/lib/addons/production-mode.js @@ -2,6 +2,7 @@ import { Addon } from "./common.js"; export default class extends Addon { async afterSetup(ctx) { + process.env.NODE_ENV = "production"; ctx.rspackArgs.push("build", "--mode", "production"); } }