M-Zuber / npm-watch

run npm scripts when files change
MIT License
323 stars 38 forks source link

How to ignore conflicting extensions? #82

Closed distante closed 3 years ago

distante commented 3 years ago

I am using npm-watch to trigger changes on my src folder, but I also have there some test files in this way:

myFile.ts
myFile.spec.ts

currently I have this config

 "transpile-dev": {
      "patterns": [
        "src"
      ],
      "extensions": "ts",
      "delay": 1000,
      "runOnChangeOnly": true
    }

but a change in a spec file trigger that task and I want to prevent this. Is there a way to do it?

M-Zuber commented 3 years ago

sure, this config should work

"transpile-dev": {
  "patterns": [
    "src"
  ],
  "extensions": "ts",
  "delay": 1000,
  "runOnChangeOnly": true,
  "ignore": [
    "*.spec.ts" 
  ]
}