vite-plugin-archiver
v0.1.1
Published
[![NPM version](https://img.shields.io/npm/v/vite-plugin-archiver?color=a1b858&label=)](https://www.npmjs.com/package/vite-plugin-archiver)
Downloads
157
Readme
vite-plugin-archiver
English | 中文
Archive the build product
Installation
npm i vite-plugin-archiver -D
Usage
// vite.config.ts
import Archiver from 'vite-plugin-archiver'
export default defineConfig({
plugins: [
Archiver(/* options */),
],
})
Options
interface VitePluginArchiverOptions {
/**
* Archive directory, defaults to the same as Vite's output directory
* See: https://cn.vitejs.dev/config/build-options#build-outdir
*
* @default build.outDir
*/
buildDir?: string
/**
* Archive types, zip and tar supported
*
* @default 'zip'
*/
archiveType: archiver.Format
/**
* zip options
* See: https://www.archiverjs.com/docs/archiver#zip-options
*
* @default { zlib: { level: 9 } }
*/
archiveZipOptions: archiver.ZipOptions
/**
* tar options
* See: https://www.archiverjs.com/docs/archiver#tar-options
*
* @default { gzip: true, gzipOptions: { level: 9 } }
*/
archiveTarOptions: archiver.TarOptions
/**
* Archive filename format, formatted using dayjs
*
* @default 'YYYY-MM-DD-HH-mm-ss'
*/
formatTemplate: string
/**
* Whether to open the archive file directory on completion
*
* @default false
*/
open: boolean
}