Skip to content

Commit

Permalink
Added HMR for plugins (hacky way)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredsgenkins committed Oct 13, 2022
1 parent 87a9aab commit fb13746
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/scandipwa/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,15 @@ if ('serviceWorker' in navigator) {
const container = document.getElementById('root');
const root = createRoot(container!);

root.render(<App />);
// Code bellow enables the hot reloading of plugins
// Why? I have no idea. Further debugging needed.
// TODO: understand why this helps HMR
if (module.hot) {
module.hot.accept();
}

function HotApp() {
return <App />;
}

root.render(<HotApp />);

0 comments on commit fb13746

Please sign in to comment.