Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/7th-Cyborg/vite-plugin-zip-pack
Vite plugin for turning your distribution folder into a zip file.
https://github.com/7th-Cyborg/vite-plugin-zip-pack
Last synced: 3 months ago
JSON representation
Vite plugin for turning your distribution folder into a zip file.
- Host: GitHub
- URL: https://github.com/7th-Cyborg/vite-plugin-zip-pack
- Owner: 7th-Cyborg
- License: mit
- Created: 2022-03-30T17:37:36.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-13T08:37:09.000Z (5 months ago)
- Last Synced: 2024-10-25T18:44:45.633Z (3 months ago)
- Language: TypeScript
- Size: 51.8 KB
- Stars: 34
- Watchers: 1
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-vite - vite-plugin-zip-pack - Pack distribution/build folder into a zip file. (Plugins / Framework-agnostic Plugins)
- awesome-vite - vite-plugin-zip-pack - Pack distribution/build folder into a zip file. (Plugins / Framework-agnostic Plugins)
README
# vite-plugin-zip-pack
[![npm](https://img.shields.io/npm/v/vite-plugin-zip-pack)](https://www.npmjs.com/package/vite-plugin-zip-pack)Vite plugin for packing distribution/build folder into a zip file.
## Install
```bash
npm i -D vite-plugin-zip-pack
```## Usage
```ts
// vite.config.jsimport { defineConfig } from "vite";
import zipPack from "vite-plugin-zip-pack";export default defineConfig({
plugins: [zipPack()],
});
```## Options
```ts
export interface Options {
/**
* Input Directory
* @default `dist`
*/
inDir?: string;
/**
* Output Directory
* @default `dist-zip`
*/
outDir?: string;
/**
* Zip Archive Name
* @default `dist.zip`
*/
outFileName?: string;
/**
* Path prefix for the files included in the zip file
* @default ``
*/
pathPrefix?: string;
/**
* Callback, which is executed after the zip file was created
* err is only defined if the save function fails
*/
done?: (err: Error | undefined) => void
/**
* Filter function equivalent to Array.prototype.filter
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
* is executed for every files and directories
* files and directories are only included when return ist true.
* All files are included when function is not defined
*/
filter?: (fileName: string, filePath: string, isDirectory: boolean) => Boolean
/**
* Enable logging
* @default true
*/
enableLogging?: boolean;
}
```
## LicenseMIT, see [the license file](./LICENSE)