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 (clear)
✓ import clear from 'rollup-plugin-clear'
✗ const { default: clear } = require('rollup-plugin-clear')
ESM default import is recommended. In CJS, use dynamic import or default extraction.
default (clear)
✓ const clear = require('rollup-plugin-clear').default;
✗ const clear = require('rollup-plugin-clear');
CJS require yields an object with default property; .default is needed.
TypeScript type
✓ import type { Options } from 'rollup-plugin-clear'
✗ import { Options } from 'rollup-plugin-clear'
Options type is available for TypeScript users; use type-only import for compile-time.
Configures rollup-plugin-clear to clean the 'dist' directory before each build.
// rollup.config.js
import clear from 'rollup-plugin-clear';
export default {
input: 'src/index.js',
output: {
dir: 'dist',
format: 'esm'
},
plugins: [
clear({
targets: ['dist'],
watch: false
})
]
};
Errors
Common errors & fixes
TypeError: clear is not a function
Incorrect import: using require without .default
fixUse `const clear = require('rollup-plugin-clear').default;` Cannot find module 'rollup-plugin-clear'
Plugin not installed or not listed in package.json
fixRun `npm install --save-dev rollup-plugin-clear`
Audit
Dependencies
No dependency data recorded yet.