# rollup-plugin-cleanup-dir

> Automatically cleanup output.dir before writing a new bundle

Latest version **1.0.8** (published 2023-04-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install rollup-plugin-cleanup-dir
pnpm add rollup-plugin-cleanup-dir
yarn add rollup-plugin-cleanup-dir
bun add rollup-plugin-cleanup-dir
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2023-04-04 |
| First published | 2022-12-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Viktor Egorov |
| Maintainers | viktor-egorov |
| Keywords | rollup, plugin, empty dir, clean dir, clear dir |

## Links

- npm: https://www.npmjs.com/package/rollup-plugin-cleanup-dir
- Repository: https://github.com/netfantom-spb/rollup-plugin-cleanup-dir
- Homepage: https://github.com/netfantom-spb/rollup-plugin-cleanup-dir#readme
- Issues: https://github.com/netfantom-spb/rollup-plugin-cleanup-dir/issues
- npm.io page: https://npm.io/package/rollup-plugin-cleanup-dir

## Dependencies (1)

- [fs-extra](https://npm.io/package/fs-extra.md) ^11.1.1

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.0.8 (latest) — 2023-04-04
- 1.0.7 — 2022-12-08
- 1.0.6 — 2022-12-08
- 1.0.5 — 2022-12-08

## README

Automatically empty the `output.dir` folder before writing a new bundle.

**Only rollup3 is supported!**

## Table of Contents

- [Getting Started](#getting_started)
- [Usage](#usage)
- [Features](#features)

## Getting started <a name = "getting_started"></a>

Use this plugin with the bundler [Rollup](https://rollupjs.org).

### Installation

```sh
$ npm i rollup-plugin-cleanup-dir -D
```

## Usage <a name = "usage"></a>

```javascript
// rollup.config.js

import cleanupDir from 'rollup-plugin-cleanup-dir'

export default {
  input: '....',
  output: {
    dir: '...',
  },
  plugins: [cleanupDir()]
}
```

This Rollup plugin has no options, it just empties the `dir` folder during the build process, right before Rollup writes any files.


## Features <a name = "features"></a>

### TypeScript Definitions <a name = "typescript"></a>

TypeScript definitions are included, so no need to install an additional `@types` library!

---
_Source: https://npm.io/package/rollup-plugin-cleanup-dir · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
