From 831d589eab58c4e526529848ce827a14559c5a74 Mon Sep 17 00:00:00 2001 From: Michael Mok Date: Mon, 29 Jun 2020 06:16:58 +0800 Subject: [PATCH] fix: correctly detect hmr plugin in run and watch modes --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index c39feb31..74ccee9a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -110,7 +110,7 @@ class ReactRefreshPlugin { const providePlugin = new ProvidePlugin(providedModules); providePlugin.apply(compiler); - compiler.hooks.beforeRun.tap(this.constructor.name, (compiler) => { + compiler.hooks.beforeCompile.tap(this.constructor.name, () => { // Check for existence of HotModuleReplacementPlugin in the plugin list // It is the foundation to this plugin working correctly if (