独特的咕噜globbing问题 [英] Unique grunt globbing issue
问题描述
Animate.css是一个惊人的库,我通过bower拉进我的项目(不能更改文件夹名称)。不幸的是,文件夹的名称是animate.css。我想在我的整个项目(包括bower_components)为 /**.*。css
。不幸的是,grunt生气,因为 animate.css
是一个文件夹,而不是一个文件。我需要一种方法来忽略文件夹,但不是文件。任何提示?
这是我的任务现在的样子:
cssmin:{
pre>
deploy:{
files:{
'<%= config.prod%> /styles.min.css':['<%= config.copy% > / ** / *。css','!** / animate.css /']
}
}
}
我有问题。
解决方案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 becauseanimate.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屋!