Ignoring test files in same dirs as source files in gulp globs

43 Views Asked by At

I have folders with test and source files mixed together

├── module-x
│   ├── module-x.hbs
│   ├── module-x.js
│   ├── module-x.less
│   └── module-x.test.js
├── module-y
│   ├── module-y.hbs
│   ├── module-y.js
│   ├── module-y.less
│   └── module-y.test.js

I have gulp running browserSync with some globs to watch files and reload the app. I can't find a glob that will watch the .js files but ignore the .test.js ones

1

There are 1 best solutions below

0
On BEST ANSWER

This ones worked for me

glob: path.resolve(root + "/**/!(*.test).js"),