除.spec.js之外的每个.js文件的节点glob模式 [英] Node glob pattern for every .js file except .spec.js

查看:217
本文介绍了除.spec.js之外的每个.js文件的节点glob模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找usemin的更好的glob模式,我想查找所有 .js 文件,但排除 .spec.js 文件。



< script src =components / ** / *(。js |!(*。spec的.js | * .scss))>< /脚本>



我目前的解决方案要求我不断添加文件扩展名来排除它们,否则它们会被拾取,例如 .html 文件。



我试图让它只查找 .js 文件并从它们中排除 .spec.js ,但它似乎不起作用。



在下面的另一个脚本中添加一个!components / ** / *。spec.js 似乎不起作用。

*。js 但不是 *。spec.js code>:

 组件/ ** /!(*。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.

解决方案

This glob includes all *.js but not *.spec.js:

components/**/!(*.spec).js

这篇关于除.spec.js之外的每个.js文件的节点glob模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆