Skip to content

Commit

Permalink
Merge pull request #1065 from wellyshen/fix/hmr-not-working
Browse files Browse the repository at this point in the history
Fix: fix HMR not working by temporary workaround
  • Loading branch information
wellyshen authored Apr 28, 2021
2 parents b5473d6 + 4741bc4 commit bde2d18
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-cool-starter",
"version": "4.3.5",
"version": "4.3.6",
"private": true,
"description": "A starter boilerplate for a universal web application with the best development experience and best practices.",
"license": "MIT",
Expand Down
6 changes: 6 additions & 0 deletions src/client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ const render = (Routes: RouteConfig[]) =>

// loadable-component setup
loadableReady(() => render(routes as RouteConfig[]));

/**
* A temporary workaround for Webpack v5 + HMR, why? see this issue: https://github.com/webpack-contrib/webpack-hot-middleware/issues/390
*/
// @ts-expect-error
if (module.hot) module.hot.accept();

0 comments on commit bde2d18

Please sign in to comment.