除.spec.js之外的每个.js文件的节点glob模式 [英] Node glob pattern for every .js file except .spec.js
问题描述
我正在寻找usemin的更好的glob模式,我想查找所有 .js
文件,但排除 .spec.js
文件。
< script src =components / ** / *(。js |!(*。spec的.js | * .scss))>< /脚本>
我目前的解决方案要求我不断添加文件扩展名来排除它们,否则它们会被拾取,例如 .html
文件。
我试图让它只查找 .js
文件并从它们中排除 .spec.js
,但它似乎不起作用。
在下面的另一个脚本中添加一个!components / ** / *。spec.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屋!