如何匹配grunt concat中的每个文件,但只有一个文件? [英] How to match every file but one in grunt concat?

查看:100
本文介绍了如何匹配grunt concat中的每个文件,但只有一个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用grunt来连接并最小化我的js文件,我对 concat 部分使用以下配置:

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'
  }
}

它匹配我的 js 文件夹中的每个文件,但我需要忽略 modernizr.js ,有没有办法做这个?我假设我需要一些匹配voodoo的模式来做到这一点,但我不知道如何。

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.

预先感谢。

推荐答案

基于文档,我会尝试:

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...

这篇关于如何匹配grunt concat中的每个文件,但只有一个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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