简体   繁体   English

grunt globbing除了文件

[英]grunt globbing except a file

I have a list of files: 我有一个文件列表:

 'app/scripts/module.js',
 'app/templates/templates.js',
 'app/scripts/**/*.js'

This will load app/scripts/module.js , app/templates/templates.js and then all the files under app/scripts/**/*.js except the one that was loaded before (module.js). 这将加载app/scripts/module.jsapp/templates/templates.js ,然后加载app/scripts/**/*.js .js下的所有文件,除了之前加载的文件(module.js)。
Now I want it to load another file located in app/scripts/a.js at the end of the list. 现在我希望它加载位于列表末尾的app/scripts/a.js中的另一个文件。
The problem is that when app/scripts/**/*.js is loaded, it already load app/scripts/a.js . 问题是当加载app/scripts/**/*.js app/scripts/a.js ,它已加载app/scripts/a.js
I want to write something like app/scripts/**/*.js (!a.js) - load all except a.js. 我想写一些类似于app/scripts/**/*.js (!a.js) - 加载除a.js以外的所有内容。
It this possible? 这有可能吗?

You want to load 'a.js', but after the other scripts? 你想加载'a.js',但是在其他脚本之后? How about this, (pulled from the docs ) 这个怎么样,(从文档中提取)

['app/scripts/**/*.js', '!app/scripts/**/a.js', 'app/scripts/**/a.js' ]

If you don't wish to load 'a.js', then just remove the last entry in the array. 如果您不想加载'a.js',那么只需删除数组中的最后一个条目。

['app/scripts/**/*.js', '!app/scripts/**/a.js']

http://gruntjs.com/configuring-tasks#globbing-patterns http://gruntjs.com/configuring-tasks#globbing-patterns

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM