From 2f676a2528a2baf1fdf9063642b9621a2fe3d566 Mon Sep 17 00:00:00 2001 From: Gavin Mogan Date: Wed, 2 Nov 2022 15:20:09 -0700 Subject: [PATCH] Use import.meta.webpackHot instead of module.hot for check --- .../templates/virtualModuleModernEntry.js.handlebars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/builder-webpack5/templates/virtualModuleModernEntry.js.handlebars b/code/lib/builder-webpack5/templates/virtualModuleModernEntry.js.handlebars index fddbe23fd1f0..9f13e58b6e8b 100644 --- a/code/lib/builder-webpack5/templates/virtualModuleModernEntry.js.handlebars +++ b/code/lib/builder-webpack5/templates/virtualModuleModernEntry.js.handlebars @@ -32,7 +32,7 @@ window.__STORYBOOK_CLIENT_API__ = new ClientApi({ storyStore: preview.storyStore preview.initialize({ importFn, getProjectAnnotations }); -if (module.hot) { +if (import.meta.webpackHot) { import.meta.webpackHot.accept('./{{storiesFilename}}', () => { // importFn has changed so we need to patch the new one in preview.onStoriesChanged({ importFn });