Webpack --watch and launching nodemon?

后端 未结 8 1532
伪装坚强ぢ
伪装坚强ぢ 2021-01-30 10:51

Thanks to an excellent answer by @McMath I now have webpack compiling both my client and my server. I\'m now on to trying to make webpack --watch be useful. Ideally

8条回答
  •  既然无缘
    2021-01-30 11:41

    I like the simplicity of nodemon-webpack-plugin

    webpack.config.js

    const NodemonPlugin = require('nodemon-webpack-plugin')
    
    module.exports = {
      plugins: [new NodemonPlugin()]
    }
    

    then just run webpack with the watch flag

    webpack --watch
    

提交回复
热议问题