1.2.3 • Published 30 days ago

vite-plugin-zip-pack v1.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
30 days ago

vite-plugin-zip-pack

npm

Vite plugin for packing distribution/build folder into a zip file.

Install

npm i -D vite-plugin-zip-pack

Usage

// vite.config.js

import { defineConfig } from "vite";
import zipPack from "vite-plugin-zip-pack";

export default defineConfig({
  plugins: [zipPack()],
});

Options

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
}

License

MIT, see the license file

1.2.3

30 days ago

1.2.2

2 months ago

1.2.1

3 months ago

1.2.0

4 months ago

1.1.0

4 months ago

1.0.7

5 months ago

1.0.6

10 months ago

1.0.5

1 year ago

1.0.2

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago