@open-tech-world/rollup-plugin-clean
A rollup plugin to remove files and folders.
Instal
With Yarn:
yarn add --dev @open-tech-world/rollup-plugin-clean
With Npm:
npm i --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: 'bundle.js',
format: 'cjs'
}
plugins: [
clean('build/**')
]
};
API Overview
clean
A function to delete files and folders in start or end build hooks.
clean(target: string | string[] | { start: target, end: target }, options: { dryRun: boolean, silent: boolean })
Props:
| 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:
| 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. |
License
MIT © Thanga Ganapathy