Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
rollup-plugin-delete
Advanced tools
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.
# 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',
format: 'cjs'
},
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 []
.
del({
targets: 'dist/*'
})
del({
targets: ['dist/*', 'build/*']
})
Output removed files and folders to console. Default is false
.
del({
targets: 'dist/*',
verbose: true
})
Note: use * (wildcard character) in pattern to show removed files
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
FAQs
Delete files and folders using Rollup
The npm package rollup-plugin-delete receives a total of 70,902 weekly downloads. As such, rollup-plugin-delete popularity was classified as popular.
We found that rollup-plugin-delete demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.