Webpack how to reload page?

the file directory structure is roughly as follows:

clipboard.png

In

index.html, dist/index.js is directly introduced into
< script src= ". / dist/index.js" > < / script >

.

executes the command "webpack--watch & webpack-dev-server" and finds that dist/index.js is updated when you change the files in the src directory, but index.html does not have reload.

ask: when changing the original src file, how can I reload index.html? at the same time?

// webpack.config.js devServer
devServer: {
  contentBase: __dirname,
  host: ip,
  port: 8081,
  historyApiFallback: true
}
Mar.02,2021

execute the command webpack-dev-server directly. You can use HMR to implement reload, but at this time the generated js is in memory and there are no files in the dist folder.
and I just need the js under dist (actually weex.js) to generate a QR code to display it, so I still haven't achieved my goal. Look forward to the great god.

// webpack.config.js
plugins: [new webpack.NamedModulesPlugin(), new webpack.HotModuleReplacementPlugin()],
devServer: {
  contentBase: __dirname,
  host: ip,
  port: 8081,
  historyApiFallback: true,
  hot: true,
  inline: true
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea3220-1c2f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea3220-1c2f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?