(WIP) Watch mode by mbehzad · Pull Request #93 · webpackmonitor/webpackmonitor · GitHub
Skip to content

(WIP) Watch mode#93

Open
mbehzad wants to merge 2 commits into
webpackmonitor:masterfrom
mbehzad:watch_mode
Open

(WIP) Watch mode#93
mbehzad wants to merge 2 commits into
webpackmonitor:masterfrom
mbehzad:watch_mode

Conversation

@mbehzad

@mbehzad mbehzad commented Dec 3, 2017

Copy link
Copy Markdown
Contributor

When webpack runs with Webpack-Monitor + lauch flag 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 #78

with commit 'bb257c0' instead of a hard error and killing the script, a message is shown in the cli informing the developer:

grafik

commit '0233e8d' goes one step further, introducing a watch flag 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.

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.
@mbehzad

mbehzad commented Dec 3, 2017

Copy link
Copy Markdown
Contributor Author

@roachjc

roachjc commented Dec 8, 2017

Copy link
Copy Markdown
Contributor

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 😀

@mbehzad

mbehzad commented Dec 24, 2017

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants