Automatically empty the output.dir
folder before writing a new bundle.
Only rollup3 is supported!
Use this plugin with the bundler Rollup.
$ npm i rollup-plugin-cleanup-dir -D
// rollup.config.js
import cleanupDir from 'rollup-plugin-cleanup-dir'
export default {
input: '....',
output: {
dir: '...',
},
plugins: [cleanupDir()]
}
This Rollup plugin has no options, it just empties the dir
folder during the build process, right before Rollup writes any files.
TypeScript definitions are included, so no need to install an additional @types
library!