Skip to content
Clear files and folders (part of the grunt-contrib collection).
JavaScript
Pull request Compare This branch is 111 commits behind gruntjs:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
tasks
.gitignore
AUTHORS
LICENSE-MIT
README.md
grunt.js
package.json

README.md

grunt-contrib-clean

Clear files and folders (part of the grunt-contrib collection). Submitted by Tim Branyen.

Getting Started

Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-contrib-clean

Then add this line to your project's grunt.js gruntfile:

grunt.loadNpmTasks('grunt-contrib-clean');

Overview

Inside your grunt.js file, add a section named clean.

Due to the destructive nature of this task, always be cautious of the paths you clean.

Config Examples

There are three formats you can use to run this task.

Short
clean: ["path/to/dir/one", "path/to/dir/two"]
Medium (specific targets with global options)
clean: {
  build: ["path/to/dir/one", "path/to/dir/two"],
  release: ["path/to/another/dir/one", "path/to/another/dir/two"]
},
Long (specific targets with per target options)
clean: {
  build: {
    src: ["path/to/dir/one", "path/to/dir/two"]
  }
}

Parameters

src string

This defines what paths this task will clean recursively (supports grunt.template and minimatch).

Release History

  • 2012/08/10 - v0.2.0 - Refactored from grunt-contrib into individual repo.
Something went wrong with that request. Please try again.