Ignoring Files and Folders with Grunt Contrib Clean
Frank Stallone had a good start on how to do this:
http://iamfrankstallone.com/ignoring-files-grunt-contrib-clean/
I wanted to share (and also post so I would have a place to reference it myself!) how to exclude specific files. In this example, I wanted to delete all files EXCEPT the font-awesome/fonts/* and requirejs/*.js:
clean:
distFinal:
files: [
dot: true
src: [
"<%= yeoman.dist %>/bower_components/*"
"!<%= yeoman.dist %>/bower_components/font-awesome/**"
"<%= yeoman.dist %>/bower_components/font-awesome/*"
"!<%= yeoman.dist %>/bower_components/font-awesome/fonts"
"!<%= yeoman.dist %>/bower_components/requirejs/**"
"<%= yeoman.dist %>/bower_components/requirejs/*"
"!<%= yeoman.dist %>/bower_components/requirejs/*.js"
]
]
Written by jeff froom
Related protips
1 Response
Thank you. That was very helpful!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Gruntjs
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#