M-Zuber/npm-watch

How to ignore certain files?

steric85 opened this issue · 3 comments

I wanted to watch only the js files and call the script lint on any change. So for that I had written:

"watch": {
    "lint": "*.js"
  },
"scripts": {
    "lint": "chmod +x script.sh | ./script.sh",
    "lint-watch": "npm-watch"
  }

Now I wish to ignore certain folder, how shall I do so?

"watch": {
    "lint": {
          "ignore": "foldername/*.js"
    }
  },

Writing the above lines does not work .
Also, What is the pattern key for?

Solved the doubt using the following code:

"watch": {
    "lint": {
      "patterns": "*",
      "extensions": "js,jsx",
      "ignore": "foldername"
    }
  },
  "scripts": {
    "lint": "chmod +x script.sh | ./script.sh",
    "lint-watch": "npm-watch"
  }

Please let me know if something is wrong.
Thanks!

That looks correct, do you feel up to /an interest in making a PR to the README to make sure the usage of ignore is clear?

Yeah , No problem