A Rollup plugin that clears the output directory before each build, ensuring a clean state and preventing leftover files from previous builds. Version 1.0.0 is the current stable release. It is a lightweight plugin with a simple configuration, allowing users to specify target directories to clear. The release cadence is low; no recent updates. Key differentiators: dedicated solely to clearing directories, unlike other plugins that bundle multiple utilities. Use with Rollup for build automation.
npm install rollup-pluginVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of clearing the 'dist' directory before each Rollup build.
Ensure all target directories exist or handle errors. Alternatively, use a plugin like 'rollup-plugin-delete' which creates directories if needed.
Clear before build, not during. The plugin clears before the build hook, so it should be safe, but test with your configuration.
Create the directory before running the plugin or ensure the path is correct.
Use 'import clearDirectory from 'rollup-plugin-clear-directory';'