第一步

  devServer: {
    contentBase: path.join(__dirname, 'dist'),
    compress: true,
    port: 9000,
    hot: true
  },

 

第二部

  plugins: [
    new HtmlWebpackPlugin(),
    new webpack.HotModuleReplacementPlugin()
  ]

 

第三部(入口文件,entry)

if (module.hot) {
  module.hot.accept()
}

 

官方介绍

相关文章:

  • 2021-06-26
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
  • 2022-02-04
  • 2022-12-23
  • 2021-08-12
猜你喜欢
  • 2022-12-23
  • 2021-07-07
  • 2021-09-21
  • 2021-11-03
  • 2022-12-23
  • 2021-09-11
  • 2022-12-23
相关资源
相似解决方案