独特的咕噜globbing问题 [英] Unique grunt globbing issue

查看:155
本文介绍了独特的咕噜globbing问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Animate.css是一个惊人的库,我通过bower拉进我的项目(不能更改文件夹名称)。不幸的是,文件夹的名称是animate.css。我想在我的整个项目(包括bower_components)为 /**.*。css 。不幸的是,grunt生气,因为 animate.css 是一个文件夹,而不是一个文件。我需要一种方法来忽略文件夹,但不是文件。任何提示?



这是我的任务现在的样子:

  cssmin:{
deploy:{
files:{
'<%= config.prod%> /styles.min.css':['<%= config.copy% > / ** / *。css','!** / animate.css /']
}
}
}
pre>

我有问题

解决方案

您可以为文件对象提供过滤器属性以过滤目录

  cssmin :{
deploy:{
files:[
{
src:['<%= config.copy%> / ** / *。css'],
dest:'<%= config.prod%> /styles.min.css',
filter:'isFile'
}
]
}
}


Animate.css is an amazing library that I'm pulling into my project via bower (can't change the folder name). Unfortunately, the folder's name is "animate.css". I want to glob in my whole project (including bower_components) for /**.*.css. Unfortunately, grunt gets angry because animate.css is a folder, not a file. I need a way to ignore the folder, but not the file. Any tips?

Here's what my task looks like now:

cssmin: {
  deploy: {
    files: {
      '<%= config.prod %>/styles.min.css': ['<%= config.copy %>/**/*.css', '!**/animate.css/']
    }
  }
}

I have an issue on the project. Feel free to respond there.

解决方案

You can supply a filter property to the files object to filter out directories:

cssmin: {
  deploy: {
    files: [
      {
        src: ['<%= config.copy %>/**/*.css'],
        dest: '<%= config.prod %>/styles.min.css',
        filter: 'isFile'
      }
    ]
  }
}

这篇关于独特的咕噜globbing问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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