简体   繁体   中英

Node glob pattern for every .js file except .spec.js

I am looking for a better glob pattern for usemin, i want to to find all .js files but exclude the .spec.js files. I have the following solution so far.

<script src="components/**/*(.js|!(*.spec.js|*.scss))"></script>

The solution i have at the moment requires me to keep adding file extensions to exclude them, else they get picked up, for example .html files.

I tried to make it only look for .js files and exclude the .spec.js from them but it does not seem to work.

Also adding a !components/**/*.spec.js as another script below does not seem to work.

这个glob包括所有*.js但不包括*.spec.js

components/**/!(*.spec).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