Registry / devops / rollup-plugin-del

rollup-plugin-del

JSON →
library1.0.1jsnpmunverified

A Rollup plugin that deletes specified files or directories before or after a build, commonly used to clean the output directory (e.g., dist). Version 1.0.1, last updated 2022. It wraps the `del` package to support glob patterns and automatically falls back to Rollup's output dir/file. Lightweight, no external plugin dependencies. Differentiates from @rollup/plugin-clean by offering glob flexibility and automatic output detection.

npm install rollup-plugin-del
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-DEL
R
rollup-plugin-del
devopsjavascriptv1.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import del from 'rollup-plugin-del'
import { del } from 'rollup-plugin-del'
Plugin is exported as default. Named export does not exist.
default
const del = require('rollup-plugin-del').default
const del = require('rollup-plugin-del')
In CommonJS, the default export is accessed via .default because the package uses ESM.
default
import del from 'rollup-plugin-del'
import del = require('rollup-plugin-del')
TypeScript with `esModuleInterop: false` may require `import del = require('rollup-plugin-del')` but that syntax is uncommon; prefer `esModuleInterop: true`.

Basic Rollup config that cleans the dist directory using default output detection before bundling.

// rollup.config.js import del from 'rollup-plugin-del'; import resolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; export default { input: 'src/index.js', output: { dir: 'dist', format: 'esm' }, plugins: [ del(), // deletes dist before build resolve(), commonjs() ] };
Debug
Known issues
gotchaUses `del` under the hood which cannot delete the current working directory itself – avoid using dest: process.cwd()
fix
Specify a subdirectory like 'dist', not the root.
affects: >=1.0.0
gotchaPlugin runs once on build start – not on watch rebuild. Files deleted during watch may cause errors.
fix
Restart Rollup after changes or consider other cleanup strategies.
affects: >=1.0.0
gotchaThe `del` peer dependency is not bundled; you must install `del` separately if not already present.
fix
Run `npm install del -D` alongside rollup-plugin-del.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'del'
Missing peer dependency `del`.
fix
Install del: npm install del --save-dev
TypeError: del is not a function
Using named import { del } instead of default import.
fix
Change to `import del from 'rollup-plugin-del'`
Error: EACCES: permission denied, unlink '...'
Attempting to delete files that the process does not have permissions for.
fix
Run with appropriate permissions or adjust file paths.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
delrequiredCore deletion logic uses the del package for glob matching
Agent activity
7 hits · last 30 days
node
6
Resources
rollup-plugin-del — npm install rollup-plugin-del · libregistry