简体   繁体   中英

PM2: ignore watch folder glob pattern

I want pm2 to stop watching folders which have a name like cache or tmp .

I tried a lot of manners in my app.json config file :

{"apps": [{
    "name": "BSTAT",
    "script": "./server/app.js",
    "watch": true,
    "ignore_watch": [
        "HERE IS WHAT I HAVE TRIED ==>",
        "*cache*",
        "*/cache",
        "cache/",
        "*cache/*"
    ],
}]}

and also saw this question who doesn't seem to have an exemple of that case.

The only way that I find to resolve the problem was to put the exact path like server/my-module/cache

I can not bring myself to think this is not possible...that's why I request your help :)

you need a regex for this, eg:

ignore_watch : ['./**/*tests.js', ] 

this pattern will ignore all files with name "tests.js" in all project folders

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM