Webpack --watch and launching nodemon?

后端 未结 8 1525
伪装坚强ぢ
伪装坚强ぢ 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
    
    0 讨论(0)
  • 2021-01-30 11:41

    Assuming nodemon server.js touch the server.js file afterEmit:

    // webpack.config.js
    
    module.exports = {
      // ...
      plugins: [
        // ...,
    
        //                                                                     
    0 讨论(0)
提交回复
热议问题