Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 2 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 (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-02T23:40:43.000Z (almost 2 years ago)
- Last Synced: 2024-10-04T21:13:45.933Z (3 months ago)
- Language: JavaScript
- Size: 1.16 MB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
rollup-plugin-empty-dir
[![npm (scoped)](https://img.shields.io/npm/v/rollup-plugin-empty-dir.svg)](https://www.npmjs.com/package/${}/rollup-plugin-empty-dir)
[![GitHub last commit](https://img.shields.io/github/last-commit/bumble-org/rollup-plugin-empty-dir.svg)](https://github.com/bumble-org/rollup-plugin-empty-dir)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)
[![TypeScript Declarations Included](https://img.shields.io/badge/types-TypeScript-informational)](#typescript)[![Fiverr: We make Chrome extensions](https://img.shields.io/badge/Fiverr%20-We%20make%20Chrome%20extensions-brightgreen.svg)](https://www.fiverr.com/jacksteam)
[![ko-fi](https://img.shields.io/badge/ko--fi-Buy%20me%20a%20coffee-ff5d5b)](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.jsimport { 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!