一覧へ戻る
vladshcherbin/rollup-plugin-delete(新しいタブで開きます)
主要言語: TypeScript
Delete files and folders using Rollup
- star 数
- 70
- watcher 数
- 1
- fork 数
- 4
- issue 数
- 0
- 最終更新
- 2025/12/11
主要言語: TypeScript
Delete files and folders using Rollup
Delete files and folders using Rollup.
This plugin is useful when you want to clean dist or other folders and files before bundling. It's using del package inside, check it for pattern examples and additional options.
# pnpm pnpm add rollup-plugin-delete -D # yarn yarn add rollup-plugin-delete -D # npm npm install rollup-plugin-delete -D
// rollup.config.js import del from 'rollup-plugin-delete' export default { input: 'src/index.js', output: { file: 'dist/app.js' }, plugins: [ del({ targets: 'dist' }) ] }
There are some useful options:
A string or an array of patterns of files and folders to be deleted. Default is [].
// Folder del({ targets: 'build' }) // Files del({ targets: 'dist/*.js' }) // Multiple targets del({ targets: ['dist/*', 'images/*.webp'] })
Output removed files and folders to console. Default is false.
Note
Use * (wildcard character) in pattern to show removed files
del({ targets: 'dist/*', verbose: true })
Rollup hook the plugin should use. Default is buildStart.
del({ targets: 'dist/*', hook: 'buildEnd' })
Type: boolean | Default: false
Delete items once. Useful in watch mode.
del({ targets: 'dist/*', runOnce: true })
All other options are passed to del package which is used inside.
MIT