A few seconds.


A webpack plugin to remove your build folder(s) before building

Clean for webpack

A webpack plugin to remove/clean your build folder(s) before building

Build Status Coveralls Status


npm install clean-webpack-plugin --save-dev

Example Webpack Config

var CleanWebpackPlugin = require('clean-webpack-plugin');

module.exports = {
  plugins: [
    new CleanWebpackPlugin(['dist', 'build'], {
      root: '/full/project/path',
      verbose: true,
      dry: false,
      exclude: ['shared.js']


new CleanWebpackPlugin(paths [, {options}])

Paths (Required)

An [array] of string paths to clean

['dist', 'build']

Options and defaults (Optional)

  "root": "[location of webpack.config]", // An absolute path for the root.
  "verbose": true, // Write logs to console.
  "dry": false, // Use boolean "true" to test/emulate delete. (will not remove files).
                // (Default: "false", remove files)
  "exclude": ["files", "to", "ignore"] // Instead of removing whole path recursively,
                                       // remove all path's content with exclusion of provided immediate children.
                                       // Good for not removing shared files from build directories.
  "watch": false // If true, remove files on recompile. (Default: false)



Pincer is a project which aims to provide best library discovery tools for developers. We're growing day by day. We have only npm platform for now but we will add the others as much as we can.