@open-tech-world/rollup-plugin-clean

A rollup plugin to remove files and folders.
Instal
Using Yarn
yarn add --dev @open-tech-world/rollup-plugin-clean
Using npm
npm install --save-dev @open-tech-world/rollup-plugin-clean
Usage
import clean from '@open-tech-world/rollup-plugin-clean';
export default {
entry: 'src/index.js',
output: {
file: 'lib/index.js',
format: 'esm'
}
plugins: [
clean('build/**')
]
};
API Overview
clean
A function to delete files and folders in rollup build hooks(start or end).
clean(target: string | string[] | { start: target, end: target },
options: { dryRun: boolean, silent: boolean, dot: boolean })
Parameters:
| target | String | String[] | { start, end } | undefined | The target paths to remove. The target string matched using glob pattern. The default hook is start when string or string array passed. When an object is passed as target, use start or end prop to specify the target paths to clean. |
| options | Object | undefined | The options to control the behaviour of clean function. See below table for options properties. |
Options props:
| dryRun | Boolean | false | Flag to disable clean function and it reports the target paths to be cleaned in the console. |
| silent | Boolean | false | Flag to disable any outputs in the console. Note that it will also disable any warnings in the console. |
| dot | Boolean | true | Flag to disable deleting of dot files. |
License
MIT © Thanga Ganapathy