The watch flag isn't passed to the individual compilers, so the plugin's test of compiler.options.watch is insufficient. Maybe hooking into watch-run for starting is the best event to start the server for this scenario.
Also, make sure that multiple live reload servers don't get started if the plugin is included multiple times on the same port.
When running
webpack --watch
with a config like the followingThe
watch
flag isn't passed to the individual compilers, so the plugin's test ofcompiler.options.watch
is insufficient. Maybe hooking intowatch-run
for starting is the best event to start the server for this scenario.Also, make sure that multiple live reload servers don't get started if the plugin is included multiple times on the same port.