Unique grunt globbing issue

我只是一个虾纸丫 提交于 2019-12-13 18:32:28

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/24503077/unique-grunt-globbing-issue

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