Webpack watch mode 4.42.1, and html-webpack-plugin 4.0.4 with cache enabled results that templates get erased
See original GitHub issueGiven: osx 10.14.6 node: 13.6.0 webpack: 4.42.1 html-webpack-plugin: 4.0.4 html-webpack-harddisk-plugin: 1.0.1
When running webpack in watch mode and html-webpack-plugin configured by default results that templates get erased after some time. Problem can be solved by providing cache: false to html-webpack-plugin settings.
Also, webpack configured to use devMiddleware so actual javascript is not emitted.
Maybe I can provide some additional info? If so, I’ll be glad.
Thank you!
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
html was not generated in watch mode, after changing one of ...
The only way is disabling the html-webpack-plugin cache.
Read more >How to watch index.html using webpack-dev-server and html ...
The problem is that index.html is not being watched by Webpack. It only watches those files that are "required" or "imported" somewhere in...
Read more >html-webpack-plugin - npm
This is a webpack plugin that simplifies creation of HTML files to serve your webpack bundles. This is especially useful for webpack bundles ......
Read more >Webpack 4 Template - Customizations
We will now look into how to write our own configurations so that we can have greater control on what webpack should do....
Read more >Third-party software dependencies | Elastic Cloud Enterprise ...
Library Version Optional/Required Packaged
org.scala‑lang.modules 1.1.1 Required Yes
org.apache.zookeeper 3.5.3‑beta Required Yes
org.apache.curator 4.2.0 Required Yes
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@Reeywhaar Thanks for the fast reply!
I started playing with the configuration of
clean-webpack-plugintoo. I generate.cshtmloutside of theoutput.pathwhich is whyCleanWebpackPlugindidn’t delete them correctly.So for me the following config works:
Thank you so much for this! You have no idea how long I have been looking for the reason why my
webpack-dev-serverwas stuck. 🎉Ok, so problem is that I also use clean-webpack-plugin. Steps are goes like:
Interesting how at initial compilation clean-webpack-plugin goes first and harddisk-plugin second, but consequent compilation order is swapped.
So, I’m sure it’s not harddisk-plugin problem anymore but rather proper configuration of clean-webpack-plugin. What do you think? Should I close the issue?