-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HMR triggers full page reload since version 3.x with html-webpack-plugin 2.x #5505
Comments
I was able to reproduce this using the vue-cli; This is the fastest way to test it out:: |
It's a combination of
and webpack-dev-server HtmlWebpackPlugin writes the I recommend to not use |
Ahhhhh I think this is really because html-webpack-plugin is forcing the emit event every time. This code is suspect. // force page reload when html-webpack-plugin template changes
compiler.plugin('compilation', function (compilation) {
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
hotMiddleware.publish({ action: 'reload' })
cb()
})
}) When I comment out the following line: cc @jantimon |
@TheLarkInn The html-webpack-plugin has some code which should prevent that: However the best way would be if webpack would allow me to create a child compiler which only recompiles if one of the child compilers source files changes. Right now I have to start the child compiler for the html generation in every webpack I guess providing a better childCompiler could increase the performance of many many many webpack compilations out there. The idea of HtmlWebpackHarddiskPlugin is to help complex setups which produce a template which is than used by express server plugins which work only with files from disk or sth similar use cases. It should be used only for that - (therefore it is not part of the html-webpack-plugin) |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
Since i upgraded webpack to version 3.x HMR doesn't work anymore.
It always triggers a full page reload (inject js or scss).
It might be related to html-webpack-plugin jantimon/html-webpack-plugin#760
The same config does work with
webpack@2.x
,webpack-dev-server@2.x
andhtml-webpack-plugin@2.x
If the current behavior is a bug, please provide the steps to reproduce.
minimal repository, HMR does a full reload as soon as webpack has been updated
https://github.com/hendrikeng/webpackHMRtest
The text was updated successfully, but these errors were encountered: