Search code examples
node.jsnodemon

Nodemon not using the --ignore option


I am using Nodemon on an Expressjs project. I have the following in my package.json:

"start": "nodemon server.js --ignore 'src/**'"

I have tried several variations of the ignore glob, but every time, it still restarts when a file in 'src/' changes.

What do I need to do to get Nodemon to ignore the src directory?

Thanks.


Solution

  • You can try to add a config nodemon.json with content below:

    {
      "verbose": true,
      "ignore": ["src/*"]
    }
    

    "start": "nodemon server.js --config nodemon.json"

    Ref: https://github.com/remy/nodemon