grunt-rm

rm -rf grunt task

grunt-rm

Grunt multi-task that removes specified files and directories.

npm install grunt-rm

For more information see grunt.js documentation: https://github.com/cowboy/grunt/blob/master/docs/toc.md

rm: {
  foo: 'js/*/**',
  bar: [
    'css/reset.css',
    'css/style.css'
  ],
  someDir: {
    dir: 'css/images/'
  }
}
  • Change to fs.existsSync with backwards compatibility (thanks to pcottle)