Wepack-hot-middleware hot update css,js can be refreshed, but html file changes will not be refreshed, how to solve?

webpack configuration:


entry:{
        "index":["webpack-hot-middleware/client?path=/__webpack_hmr&timeout=10000&reload=true",path.resolve("assets/view/index/entry.js")],
        "sub":["webpack-hot-middleware/client?path=/__webpack_hmr&timeout=10000&reload=true",path.resolve("assets/view/sub/entry.js")]
    },

  ....

  plugins: [
        new webpack.HotModuleReplacementPlugin(),
        new webpack.NoEmitOnErrorsPlugin()
    ]
    
< hr >

Code in express

if (process.env.DEV_MODE === "dev") {

    let webpack = require("webpack");
    let webpackDevMiddleWare = require("webpack-dev-middleware");
    let webpackHotMiddleWare = require("webpack-hot-middleware");
    let webpackConfig = require("./webpack.dev.config");
    let complier = webpack(webpackConfig);

    app.use(webpackDevMiddleWare(complier, {
        stats: {
            assets: true,
            children: false,
            modules: false,
            colors: true
        }
    })); 

    app.use(webpackHotMiddleWare(complier));
}
The

service is up, and it can also be packaged through webpack-dev-middleware , and the HRM is also valid. If you change the css,js, you will automatically refresh it, but the html code will be changed and the page will not be refreshed.
how do you solve this problem?

Mar.01,2021

change css no change

Menu