A Rollup plugin that executes the rm (remove) command during build hooks, specifically buildStart or buildEnd. Version 1.0.2 (current stable) has a low release cadence. It is a minimal alternative to rollup-plugin-delete or rollup-plugin-clean, offering no-config deletion via a simple string path argument. It ships TypeScript types and requires Rollup 3 or 4 as a peer dependency. Unlike alternatives, it does not support glob patterns or multiple directories—only a single path removal.
npm install rollup-plugin-rmVerified import paths — ran on the pinned version, not inferred.
Shows removal of 'dist' folder at buildStart and 'dist/types' at buildEnd using the Rollup plugin.
Use multiple rm() calls for each directory, or switch to rollup-plugin-delete for glob support.
For large directories, remove synchronously via buildStart/buildEnd hooks manually using fs.promises.rm.
Monitor GitHub releases for potential breaking changes.
Check existence before calling rm plugin; the underlying rimraf version may throw on ENOENT.
Upgrade Rollup to version 3 or 4, or use rollup-plugin-delete which supports Rollup 2.
Use `import rm from 'rollup-plugin-rm'`
Migrate to ESM ('type':'module' in package.json) or use dynamic import: `const rm = (await import('rollup-plugin-rm')).default`Run `npm install rollup --save-dev`
Pass a single string path: `rm('dist', 'buildStart')`. Use multiple calls for multiple paths.