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
muslnode 18–223 runs
build_error
glibcnode 18–223 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()
]
};
Errors
Common errors & fixes
Error: Cannot find module 'del'
Missing peer dependency `del`.
fixInstall del: npm install del --save-dev
TypeError: del is not a function
Using named import { del } instead of default import.
fixChange to `import del from 'rollup-plugin-del'`
Error: EACCES: permission denied, unlink '...'
Attempting to delete files that the process does not have permissions for.
fixRun with appropriate permissions or adjust file paths.
Audit
Dependencies
delrequiredCore deletion logic uses the del package for glob matching