This webpack plugin clean old files after build.
Just as the well-known plugin clean-webpack-plugin, and more than it.
- only delete after webpack compile
- skip plugin if compile error
- multiple entry / path support
- include / exclude files support
- verbose / mute info support
- colorful log with chalk
- example with webpack
- support cross platform
// use npm
npm install -D del-webpack-plugin
// use yarn
yarn add -D del-webpack-plugin
const DelWebpackPlugin = require('del-webpack-plugin')
{
plugins: [
new DelWebpackPlugin({
info: true,
exclude: ['test.js']
})
]
}
console.log added files and deleted files
- type: Boolean
- default: true
a file list you wanna delete it will delete all files and folders by default
- type: [String]
- default: ['**']
- example: ['trash.js', 'trash/*.js']
// only files not folders use ['**.*']
a file list you dont wanna delete
- type: [String]
- default: []
- example: ['test.js', 'test/*.js']
Welcome any issues and PRs submit :D