How to match every file but one in grunt concat?

余生长醉 提交于 2019-12-18 14:05:11

问题


I'm using grunt to concatenate and minimize my js files, I use the following config for the concat part:

concat: {
  dist: {
    src: ['<banner:meta.banner>', 'js/*.js'],
    dest: 'js/script.js'
  }
}

It matches every file in my js folder but I need to ignore modernizr.js, is there a way to do this? I assume I'd need some pattern matching voodoo to do it but I'm not sure how.

Thanks in advance.


回答1:


Based on documentation I would try:

js/!(modernizr).js
(js/)!(modernizr).js
{js/}!(modernizr).js
js/!({modernizr}).js
(js/)!({modernizr}).js
{js/}!({modernizr}).js
js/!{modernizr}.js
(js/)!{modernizr}.js
{js/}!{modernizr}.js

If none of them is going to work, then probably you are of out luck...



来源:https://stackoverflow.com/questions/11064773/how-to-match-every-file-but-one-in-grunt-concat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!