run-script-webpack-plugin icon indicating copy to clipboard operation
run-script-webpack-plugin copied to clipboard

Detect HMR and disable autoRestart if one is presented

Open atassis opened this issue 3 years ago • 6 comments

#20 related

Ideally, the code would be smart enough to detect that HMR is in use, but at the minimum, there should be documentation present regarding the autoRestart flag.

atassis avatar Jul 12 '22 06:07 atassis

have you figure it this out ?

sibelius avatar Aug 01 '24 03:08 sibelius

At that time I was thinking about moving dev server from backend to root webpack config- an array of configurations. But I haven't managed to make it properly (so that hmr hooks up properly, etc), it was easier for me to make backend code changes and restart client app in browser if needed. The thing is this exact issue is out of scope of this particular plugin IMHO. It does what it does, hmr should be resolved separately. While I was writing this, I came to an idea to make a debounced delay for restart to let HMR send the changes to the client and then restart the script (I am not sure if plugin has an access to the inner webpack instance of client)

atassis avatar Aug 01 '24 10:08 atassis

I think you can get hmr info inside the plugin, we just need to figure it out how

sibelius avatar Aug 01 '24 11:08 sibelius