(WIP) Watch mode#93
Conversation
adds console warning when the express server is already running and starting a new one on the same port throws a error.
…llow to call webpack monitor multiple of times, and the launched express server only updates its data.
|
Hi @mbehzad thanks again for another PR! Commit bb257c0 is great and a much needed error handler, so thank you for that. Would you mind submitting that as its own PR and I will merge it in? Regarding 0233e8d, here are my thoughts: It is quite common for the production and development builds to be substantially different. Mixing the two build types in the stats output would compromise wpm's ability to describe the trend of the build over time. In development mode, the whole build would likely be significantly larger, any libs that have prod and dev modes (eg React) would be different, output filenames could be different etc etc. The charting is organized in such a way that if a single very large build is added, all the other builds would be dwarfed and less readable. I totally agree with you that there is a legit use case for such a tool, I'm just not sure that WPM in its current form is where it should be. If such a feature was to be included, I would imagine it in a separate view that deals specifically and only with the current dev build served by webpack-dev-server while keeping the main area as only concerned with production builds over time. I hope that makes sense. I would be interested to hear your thoughts! Thank you again for your involvement 😀 |

When webpack runs with Webpack-Monitor +
lauchflag in watch mode, starting a new express instance each time would throw an error because of the port being in use. see issues #48, #69 and #78with commit 'bb257c0' instead of a hard error and killing the script, a message is shown in the cli informing the developer:
commit '0233e8d' goes one step further, introducing a
watchflag to the webpack monitor's options. When set, to prevent bloating the state json, only the last entry in the data is updated and instade of writing the json to the disk it is pushed to the running express instance. This allows running webpack monitor in a watch mode without any issues and showing the current bundles info.