Home > Software engineering >  Webpack devServer v. 4.x.x live reload not working
Webpack devServer v. 4.x.x live reload not working

Time:10-16

I'm following these enter image description here

If it matters, the above is from VS Code's Bash terminal, and I'm running Windows 10.

2) BONUS: What configuration changes do I need to make in order to live reload a static index.html file located in the project's root folder?

CodePudding user response:

This configuration should do the trick:

devServer: {
    hot: false, // optional, but you must not set both hot and liveReload to true
    liveReload: true
}

The live-reloading of the static index.html can be achieved with this plugin configuration:

plugins: [
  ...,
  new HtmlWebpackPlugin({ template: "src/index.html" })
]
  • Related