Closed antmdvs closed 8 years ago
thinking this would prevent them from being recompiled every time I saved one of my own files
Yes, that is what happens. But if your compiled vendor bundle contains errors, they are still going to show up each time it's loaded.
Is there a way to suppress the HMR overlay until the 3rd party deps get fixed.
Done. I've just published aspnet-webpack
version 1.0.17
, so upgrade to that. Then you can optionally specify your webpack-hot-middleware/client
options manually in webpack.config.js
. For example, change your entry
config value to this:
entry: { 'main-client': ['webpack-hot-middleware/client?overlay=false', './ClientApp/boot-client.ts'] },
... and then you won't get the overlay. You probably only want to do this in development builds (because you don't want HMR in production) so you might want to wrap that part of your config in an if(isDevBuild) { ... }
test or similar.
Done. I've just published aspnet-webpack version 1.0.17
Wow, you are quick! Did you already have that one in your back pocket? :)
I'll give it a shot. Thanks, Steve
Well, it does suppress the overlay, but it still doesn't hot reload my own stuff.
Steps to repro:
yo aspnetcore-spa
(ReactRedux)entry: { 'main-client': ['webpack-hot-middleware/client?overlay=false', './ClientApp/boot-client.tsx'] },
npm install apollo-client --save
'apollo-client'
to the end of the 'vendor' array on line 18.webpack --config webpack.config.vendor.js
import ApolloClient from 'apollo-client';
Note that the errors appear in the console (happy), the overlay is suppressed (happy), but the new Counter code doesn't update (sad).
Sounds like HMR is running but has some incompatibility with apollo-client
, or maybe Webpack's HMR code is hard-coded not to apply updates if it saw there was an error. I'm afraid this is something you'll have to take up with the apollo-client
or Webpack folks :(
I've added some 3rd party packages that are causing TypeScript compilation errors. As such, the HMR overlay is popping up on every HMR bundle injection. I tried moving those packages to the vendor output bundle (thinking this would prevent them from being recompiled every time I saved one of my own files -- isn't that the point of the vendor bundle???) but the overlay is still displayed every time I save.
Is there a way to suppress the HMR overlay until the 3rd party deps get fixed. The below link describes how to do it but I'm not sure how to translate it into this project (does the HMR config code live in aspnet-webpack-react?)
https://github.com/glenjamin/webpack-hot-middleware#config