简体   繁体   English

独特的grunt globbing问题

[英]Unique grunt globbing issue

Animate.css is an amazing library that I'm pulling into my project via bower (can't change the folder name). Animate.css是一个很棒的库,我通过bower进入我的项目(无法更改文件夹名称)。 Unfortunately, the folder's name is "animate.css". 不幸的是,文件夹的名称是“animate.css”。 I want to glob in my whole project (including bower_components) for /**.*.css . 我希望在我的整个项目(包括bower_components)中为/**.*.css Unfortunately, grunt gets angry because animate.css is a folder, not a file. 不幸的是,grunt生气,因为animate.css是一个文件夹,而不是文件。 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 : 您可以为files对象提供filter属性以过滤掉目录

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

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

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