-
Notifications
You must be signed in to change notification settings - Fork 519
Have option in UseWebpackDevMiddleware to load existing js files on startup #555
Comments
In general I'm open to this possiblity, but one potential drawback is that it could be very confusing to developers. For example, if you edit some TypeScript code, and then start up your app, you'd expect to see the latest version of your code running in the browser, but with this option you might still see the previous version running, depending on whether the Webpack compilation completed before or after the page load completed. Inconsistencies like that may seem random to unfamiliar developers, leading to time wasted tracking down nonexistent bugs. Ideally we'd serve the previously-compiled files only if we know the source files haven't changed in the meantime, but I'm not sure there'd be a simple and reliable way to know that. |
One possible option, which is far from perfect, but worked for me:
It will work so, that all webpack output will be put into |
A few months of thought later, I no longer think this is something we should do, at least not as a built-in feature. The cost of continually confusing developers by sometimes running old versions of the code, ignoring your latest changes (but not always! it's a race condition!), is likely to outweigh the benefit of shaving a few seconds off the build time. If someone one day comes up with a proposed implementation that gives the benefits without the costs, we can certainly reconsider. @Aleksanderis's technique above is a good approach for more confident developers who want to take manual responsibility for this. |
I have been running `webpack -w` as a separate independent process for a
while. Implicitly running it for every dotnet rebuild is not good design.
Thank you for your comments, nonetheless.
…On Mon, May 22, 2017, 4:55 AM Steve Sanderson ***@***.***> wrote:
Closed #555 <#555>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#555 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAq5yh5Wow2MkM8uofLHt_DwnXeU8VBEks5r8Wm5gaJpZM4LaOI5>
.
|
Is there any way not to re-build typescript when I run my project with CTRL-F5, but still have HMR ? I want to rebuild it myself by running webpack in watch mode. |
This is in relation to #545. Currently using VC Code to work on a ASP.Net Core/VueJS project. I'm using dotnet-watch to automatically restart the server on backend code changes. Doing so also restarts webpack fully. This adds 3-5s to an already lengthy ~10s just from restarting the server.
This is on a new project with barely any custom code. I feel it is important to shave off any build times wherever possible.
I would appreciate an option to just serve existing compiled js files when restarting the server. JS files are compiled every time on save, so I believe it's generally unnecessary to do so on server restart as well (I may be wrong about this).
The text was updated successfully, but these errors were encountered: