Registry / devops / rollup-plugin-empty

rollup-plugin-empty

JSON →
library1.0.0jsnpmunverified

A Rollup plugin for emptying directories or deleting files before a build. Version 1.0.0, stable. Differentiates by supporting both directory emptying and file deletion via fast-glob patterns, silent mode option for logging control. Useful for cleaning output directories as part of the build pipeline.

npm install rollup-plugin-empty
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-EMPT
R
rollup-plugin-empty
devopsjavascriptv1.0.0
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 empty from 'rollup-plugin-empty'
const { empty } = require('rollup-plugin-empty')
Default export in ESM, named import does not exist.
default
const empty = require('rollup-plugin-empty')
CommonJS require, works in Node without issues.
EmptyOptions
import type { EmptyOptions } from 'rollup-plugin-empty'
TypeScript users can import the options interface for type checking.

Demonstrates emptying the 'dist' directory before building with Rollup.

import empty from 'rollup-plugin-empty'; export default { input: 'src/index.js', plugins: [ empty({ silent: false, dir: 'dist' }) ], output: { dir: 'dist', format: 'es' } };
Debug
Known issues
gotchaUsing both `file` and `dir` options may lead to unintended behavior: files matching both patterns might be deleted and also the directory emptied.
fix
Use either `file` or `dir` exclusively, or carefully design patterns to avoid overlap.
affects: >=1.0
gotchaGlob patterns are resolved relative to the current working directory, not the config file location.
fix
Use absolute paths or ensure cwd is correct.
affects: >=1.0
deprecatedOption 'silent' default changed from false to true in future versions; not yet deprecated but behavior may change.
fix
Explicitly set 'silent' to desired value.
affects: >=1.0 <2.0
Errors
Common errors & fixes
TypeError: empty is not a function
Using named import instead of default import in ESM.
fix
Use `import empty from 'rollup-plugin-empty'`
ENOENT: no such file or directory, unlink '...'
The file specified in 'file' option does not exist or already deleted.
fix
Ensure files exist at build start or use 'dir' option instead.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
fast-globrequiredPowering glob matching for file and directory patterns.
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
rollup-plugin-empty — npm install rollup-plugin-empty · libregistry