vite-plugin-zip-pack-svelte
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

vite-plugin-zip-pack-svelte

npm

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

The plugin based on vite-plugin-zip-pack extends some parameters. "https://github.com/7th-Cyborg/vite-plugin-zip-pack".

Install

npm i -D vite-plugin-zip-pack-svelte

Usage

// vite.config.js

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

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;
  /**
   * update filename in configResolved
   */
  updateOutFileName?: (options: Object) => string | undefined;
  /**
  /**
   * check if file/env is valid for compression
   * such as only compress in SSR
   */
  validCompress?: (options: Object) => boolean;
  /**
   * 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

Package Sidebar

Install

npm i vite-plugin-zip-pack-svelte

Weekly Downloads

5

Version

0.0.3

License

MIT

Unpacked Size

17.1 kB

Total Files

6

Last publish

Collaborators

  • code423