Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vite plugin for packaging build folder into zip file via fflate

Vite plugin for packaging build folder into zip file via fflate.

NPM Version

Install

bun add vite-plugin-fflate-zip -D

pnpm add vite-plugin-fflate-zip -D

npm install vite-plugin-fflate-zip -D

yarn add vite-plugin-fflate-zip -D

Usage

// vite.config.ts
import { defineConfig } from "vite"
import fflateZip from "vite-plugin-fflate-zip"

export default defineConfig({
  plugins: [fflateZip()]
})

Plugin Options

interface Options {
  /**
   * Input Directory
   * @default `dist`
   */
  inDir: string;
  /**
   * Output Directory
   * @default `dist-zip`
   */
  outDir: string;
  /**
   * Zip Archive Name. 
   * @default `${pkg.name}-${pkg.version}.zip`
   */
  zipName: string;
  /**
   * Files to be excluded
   */
  excludedFiles: string[];
  /**
   * After creating the zip file execute
   */
  onArchived: () => void;
  /**
   * Execute when an error occurs
   * @param err Error message
   */
  onError: (err: Error) => void;
}

Develop

To install dependencies:

bun install

To run dev:

bun run dev

To testing at example:

bun run build:example

To build plugin:

bun run build

Authors

License

MIT License © 2024-PRESENT Caven

About

Vite plugin for packaging build folder into zip file via fflate

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages