fkdyag
Last Updated: February 25, 2016
·
2.79K
· jfroom

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"
              ]
            ]
Say Thanks
Respond

1 Response
Add your response

26679
F0549f4cfb629b78bb1d3fe80dede6c8

Thank you. That was very helpful!

over 1 year ago ·