A webpack plugin to remove/clean your build js of theme folder(s) before building
npm i clean-theme-webpack-plugin --save-dev
const CleanThemeWebpackPlugin = require('clean-theme-webpack-plugin')
{
plugins: [
new CleanThemeWebpackPlugin({ options })
]
}
plugins: [
new CleanWebpackPlugin({
root: './dist',
theme: ['blue', 'green']
})
]
{
// Absolute path to your webpack output folder
root: __dirname + '/dist',
// Your themes
theme: ['red', 'green']
}