Skip to content

Commit 73c952b

Browse files
author
Morten N.O. Henriksen
committed
Add fast refresh entries to ModuleScopePlugin
1 parent bbf93d2 commit 73c952b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/react-scripts/config/webpack.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ const webpackDevClientEntry = require.resolve(
4545
const reactRefreshOverlayEntry = require.resolve(
4646
'react-dev-utils/refreshOverlayInterop'
4747
);
48+
const reactRefreshRuntimeEntry = require.resolve('react-refresh/runtime');
49+
const reactRefreshWebpackPluginRuntimeEntry = require.resolve(
50+
'@pmmmwh/react-refresh-webpack-plugin/lib/runtime/RefreshUtils'
51+
);
4852

4953
// Some apps do not need the benefits of saving a web request, so not inlining the chunk
5054
// makes for a smoother build process.
@@ -334,6 +338,8 @@ module.exports = function (webpackEnv) {
334338
// Make sure your source files are compiled, as they will not be processed in any way.
335339
new ModuleScopePlugin(paths.appSrc, [
336340
paths.appPackageJson,
341+
reactRefreshRuntimeEntry,
342+
reactRefreshWebpackPluginRuntimeEntry,
337343
reactRefreshOverlayEntry,
338344
]),
339345
],

0 commit comments

Comments
 (0)