Skip to content

Commit 62ada50

Browse files
committed
Configure Rspack Fast Refresh plugin in development
1 parent 5945fe5 commit 62ada50

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

config/webpack/client.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,4 @@ environment.plugins.append(
2323
}),
2424
);
2525

26-
if (devBuild && isHMR && config.assets_bundler !== 'rspack') {
27-
// Rspack is the only supported bundler for this repo; no webpack refresh plugin wiring.
28-
}
29-
3026
module.exports = environment;

config/webpack/development.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
55

66
const { inliningCss } = require('shakapacker');
7+
const ReactRefreshRspackPlugin = require('@rspack/plugin-react-refresh');
78

89
const webpackConfig = require('./webpackConfig');
910

10-
const developmentEnvOnly = (_clientWebpackConfig, _serverWebpackConfig) => {
11+
const developmentEnvOnly = (clientWebpackConfig, _serverWebpackConfig) => {
1112
if (inliningCss) {
12-
// Rspack HMR/refresh is handled by Shakapacker + @rspack/plugin-react-refresh.
13-
// No extra development-only plugin wiring is needed here.
13+
clientWebpackConfig.plugins.push(new ReactRefreshRspackPlugin());
1414
}
1515
};
1616

0 commit comments

Comments
 (0)