webpack-dev-server hot reload not working

前端 未结 11 1830
囚心锁ツ
囚心锁ツ 2020-12-24 06:51

My file structure is:

dist
  css
    style.css
  index.html
  js
    bundle.js
src
  css
    style.css
  index.html
  js
    main.js
node_modules
webpack.con         


        
11条回答
  •  生来不讨喜
    2020-12-24 07:25

    None of the options on this page worked for me. After changing the devServer section to:

    devServer: {
        port: 8080,
        contentBase: ['./src', './public'], // both src and output dirs
        inline: true,
        hot: true
    },
    

    it worked.

提交回复
热议问题