Webpack --watch and launching nodemon?

后端 未结 8 1673
伪装坚强ぢ
伪装坚强ぢ 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:28

    You don't need any plugins to use webpack and nodemon, just use this scripts on your package.json

    "scripts": {
      "start": "nodemon --ignore './client/dist' -e js,ejs,html,css --exec 'npm run watch'",
      "watch": "npm run build && node ./server/index.js",
      "build": "rimraf ./client/dist && webpack --bail --progress --profile"
    },
    

提交回复
热议问题