https://github.com/jacksteamdev/rollup-plugin-empty-dir
Automatically empty output.dir before writing a new bundle.
https://github.com/jacksteamdev/rollup-plugin-empty-dir
Last synced: 9 months ago
JSON representation
Automatically empty output.dir before writing a new bundle.
- Host: GitHub
- URL: https://github.com/jacksteamdev/rollup-plugin-empty-dir
- Owner: jacksteamdev
- License: mit
- Created: 2019-05-13T15:49:07.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-02T23:40:43.000Z (almost 3 years ago)
- Last Synced: 2025-04-19T11:15:33.545Z (10 months ago)
- Language: JavaScript
- Size: 1.16 MB
- Stars: 2
- Watchers: 0
- Forks: 2
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
rollup-plugin-empty-dir
[](https://www.npmjs.com/package/${}/rollup-plugin-empty-dir)
[](https://github.com/bumble-org/rollup-plugin-empty-dir)
[](/LICENSE)
[](#typescript)
[](https://www.fiverr.com/jacksteam)
[](https://ko-fi.com/K3K1QNTF)
---
Automatically empty the `output.dir` folder before writing a new bundle. Useful for code splitting, where chunks with different hashes can accumulate from multiple builds.
## Table of Contents
- [Getting Started](#getting_started)
- [Usage](#usage)
- [Features](#features)
Use this plugin with the bundler [Rollup](https://rollupjs.org/guide/en/).
### Installation
```sh
$ npm i rollup-plugin-empty-dir -D
```
```javascript
// rollup.config.js
import { emptyDir } from 'rollup-plugin-empty-dir'
export default {
input: 'src/index.js',
output: {
dir: 'dist',
format: 'esm',
},
plugins: [emptyDir()]
}
```
This Rollup plugin has no options, it just empties the `dir` folder during the build process, right before Rollup writes any files.
TypeScript definitions are included, so no need to install an additional `@types` library!
