简体   繁体   中英

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

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

这对我有用

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

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