Here's a typical workflow:
- Edit JS file
- Save file, watchify automatically starts rebuilding it for me
- alt-tab to browser
- ctrl+R to reload page
That's great, except if watchify takes longer than steps 3 and 4, it sucks because you either get the stale code or an error.
Is there an easy way to guarantee that doesn't ever happen? Like a way for watchify to signal to my server that it should wait another split second before trying to load the requested page? If such a thing doesn't exist, how do people deal with this problem in practice?
I must suck at Googling because I can't even find people talking about this problem except this which says "Add a simple (Node-based) server that will block on requests until the watch is done running: this would avoid the always-frustrating phenomenom of reloading the page only to find the watch hasn't quite run yet." -- but unfortunately that's an entry in a todo list, not something that exists in that repo.