unplugin-zip-pack
v1.0.3-beta.0
Published
Zip your build files with JSZip, powered by unplugin
Downloads
26
Maintainers
Readme
Quick Start
npm i unplugin-zip-pack@latest -D # Or yarn/pnpm as you like
Configuration
export type Options = {
/**
* Input Dir
* @default `./dist`
*/
in?: string;
/**
* Output file name (with path)
* @default `dist.zip`
*/
out?: string;
filter?: FilterFunction;
/**
* Switcher of enable plugin
* @default true
*/
enabled?: boolean;
/**
* Hook functions run pre/post compress. (if `enabled` is set to false, hooks won't run.)
*/
hooks?: {
pre?: Promise;
post?: Promise;
}
}
Usage
// vite.config.ts
import ZipPack from 'unplugin-zip-pack/vite'
export default defineConfig({
plugins: [
ZipPack({ /* options */ }),
],
})
// rollup.config.js
import ZipPack from 'unplugin-zip-pack/rollup'
export default {
plugins: [
ZipPack({ /* options */ }),
],
}
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-zip-pack/webpack')({ /* options */ })
]
}
// nuxt.config.js
export default {
buildModules: [
['unplugin-zip-pack/nuxt', { /* options */ }],
],
}
This module works for both Nuxt 2 and Nuxt Vite
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-zip-pack/webpack')({ /* options */ }),
],
},
}
// esbuild.config.js
import { build } from 'esbuild'
import ZipPack from 'unplugin-zip-pack/esbuild'
build({
plugins: [ZipPack()],
})