Nodemon

Create a nodemon.js file in your project folder, and add the following configuration. 

mern-simplesetup/nodemon.js:

{    "verbose": false,    "watch": [ "./server" ],    "exec": "webpack --mode=development --config     webpack.config.server.js                 && node ./dist/server.generated.js"}

This configuration will set up nodemon to watch for changes in the server files during development, then execute compile and build commands as necessary.

Get Full-Stack React Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.