Skip to content

ali322/cleanup-webpack-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cleanup-webpack-plugin Build Status npm version

NPM

inspired by webpack-cleanup-plugin,cleanup files before run or after done

Usage

add plugin in your webpack.config.js

var CleanupPlugin = require('cleanup-webpack-plugin')

module.exports = {
    entry:{
        index:"./index.js"
    },
    module:{
        loaders:[
            ...
        ]
    },
    output:{
        path:'./dist',
        filename:'[name]-[hash:8].min.js'
    },
    plugins:[
      new CleanupPlugin({
        include: ['./dist/*.js']
      })
    ]
}

this plugin will delete all .js files in dist directory before webpack bundle run everytime

Plugin Options

  • include: delete files include which match glob patterns
  • exclude: delete all files exclude which match glob patterns, if include options is provide, then this option will be ignore
  • when: should be before or after

License

MIT License

About

cleanup extraneous files by webpack

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published