Skip to content

Commit

Permalink
Enable refresh in development
Browse files Browse the repository at this point in the history
  • Loading branch information
puehringer committed Feb 27, 2024
1 parent 1ca09b8 commit c0497a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ module.exports = (webpackEnv, argv) => {
throw Error(`Invalid mode passed: ${mode}`);
}

const isFastMode = env.fast?.toLowerCase() !== 'false' && isDevServer;
const isDevServerOnly = env.dev_server_only?.toLowerCase() === 'true';
const isFastMode = env.fast?.toLowerCase() !== 'false' && isDevServer && !isDevServerOnly;

if (isFastMode) {
console.log('Fast mode enabled: disabled sourcemaps, ...');
Expand Down Expand Up @@ -292,7 +292,7 @@ module.exports = (webpackEnv, argv) => {
react: {
runtime: 'automatic',
development: isEnvDevelopment,
refresh: isEnvDevelopment && isDevServer && !isDevServerOnly,
refresh: isEnvDevelopment,
},
},
},
Expand Down Expand Up @@ -408,7 +408,7 @@ module.exports = (webpackEnv, argv) => {
},
plugins: [
process.env.RSDOCTOR && new RsdoctorRspackPlugin(),
isEnvDevelopment && isDevServer && !isDevServerOnly && new ReactRefreshPlugin(),
isEnvDevelopment && new ReactRefreshPlugin(),
// TODO: Enable, but creates a warning right now
new DotenvPlugin({
path: path.join(workspacePath, '.env'), // load this now instead of the ones in '.env'
Expand Down

0 comments on commit c0497a5

Please sign in to comment.