Simple post-process file deletion for Webpack.
npm install webpack-delete-pluginnpm install webpack-delete-plugin --save-dev
const WebpackDeletePlugin = require("webpack-delete-plugin");
module.exports = {
...
plugins: [
new WebpackDeletePlugin(["./path/file.js", "./path//*", "./path/folder/"])
]
}
`
Delete entire folders with ./path/folder/**` - this will delete the folder and everything inside.