From fb13746f8679f1d9818dcdcfa05a61cebe0424f0 Mon Sep 17 00:00:00 2001 From: alfredsgenkins Date: Thu, 13 Oct 2022 18:18:47 +0300 Subject: [PATCH] Added HMR for plugins (hacky way) --- packages/scandipwa/src/index.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/scandipwa/src/index.tsx b/packages/scandipwa/src/index.tsx index 9fadf40206..4f428c4225 100644 --- a/packages/scandipwa/src/index.tsx +++ b/packages/scandipwa/src/index.tsx @@ -29,4 +29,15 @@ if ('serviceWorker' in navigator) { const container = document.getElementById('root'); const root = createRoot(container!); -root.render(); +// 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 ; +} + +root.render();