Skip to content

Commit c0497a5

Browse files
committed
Enable refresh in development
1 parent 1ca09b8 commit c0497a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

config/rspack.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ module.exports = (webpackEnv, argv) => {
2828
throw Error(`Invalid mode passed: ${mode}`);
2929
}
3030

31-
const isFastMode = env.fast?.toLowerCase() !== 'false' && isDevServer;
3231
const isDevServerOnly = env.dev_server_only?.toLowerCase() === 'true';
32+
const isFastMode = env.fast?.toLowerCase() !== 'false' && isDevServer && !isDevServerOnly;
3333

3434
if (isFastMode) {
3535
console.log('Fast mode enabled: disabled sourcemaps, ...');
@@ -292,7 +292,7 @@ module.exports = (webpackEnv, argv) => {
292292
react: {
293293
runtime: 'automatic',
294294
development: isEnvDevelopment,
295-
refresh: isEnvDevelopment && isDevServer && !isDevServerOnly,
295+
refresh: isEnvDevelopment,
296296
},
297297
},
298298
},
@@ -408,7 +408,7 @@ module.exports = (webpackEnv, argv) => {
408408
},
409409
plugins: [
410410
process.env.RSDOCTOR && new RsdoctorRspackPlugin(),
411-
isEnvDevelopment && isDevServer && !isDevServerOnly && new ReactRefreshPlugin(),
411+
isEnvDevelopment && new ReactRefreshPlugin(),
412412
// TODO: Enable, but creates a warning right now
413413
new DotenvPlugin({
414414
path: path.join(workspacePath, '.env'), // load this now instead of the ones in '.env'

0 commit comments

Comments
 (0)