https://github.com/ali322/cleanup-webpack-plugin
cleanup extraneous files by webpack
https://github.com/ali322/cleanup-webpack-plugin
cleanup webpack webpack4
Last synced: 2 months ago
JSON representation
cleanup extraneous files by webpack
- Host: GitHub
- URL: https://github.com/ali322/cleanup-webpack-plugin
- Owner: ali322
- Created: 2018-04-28T07:51:21.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-28T07:58:12.000Z (about 8 years ago)
- Last Synced: 2025-10-08T12:02:52.381Z (9 months ago)
- Topics: cleanup, webpack, webpack4
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
cleanup-webpack-plugin [](https://travis-ci.org/ali322/cleanup-webpack-plugin) [](https://badge.fury.io/js/cleanup-webpack-plugin)
===
[](https://nodei.co/npm/cleanup-webpack-plugin/)
inspired by [webpack-cleanup-plugin](https://github.com/gpbl/webpack-cleanup-plugin/blob/master/src/WebpackCleanupPlugin.js),cleanup files before run or after done
Usage
===
add plugin in your webpack.config.js
```javascript
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](http://en.wikipedia.org/wiki/MIT_License)