Registry / devops / vite-plugin-auto-zip

vite-plugin-auto-zip

JSON →
library1.2.0jsnpmunverified

A Vite plugin that automatically zips the dist directory after a production build. Current stable version is 1.2.0. It is a simple plugin that runs on build completion and creates a zip archive of the output folder. It offers configurable output zip name, target folder, and destination folder. Its key differentiator is simplicity — it does one thing and has minimal configuration (three parameters). It ships TypeScript types. Development appears sporadic (single contributor, no recent commits). Use cases are limited but straightforward.

npm install vite-plugin-auto-zip
INSTALL
IMPORT
SIG · VITE-PLUGIN-AUTO-Z
V
vite-plugin-auto-zip
devopsjavascriptv1.2.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AutoZip
import AutoZip from 'vite-plugin-auto-zip'
import { AutoZip } from 'vite-plugin-auto-zip'
Default export, not named. TypeScript types are included.
autoZip (default)
const AutoZip = require('vite-plugin-auto-zip')
const { AutoZip } = require('vite-plugin-auto-zip')
CommonJS require gets the default export as a single function.
config
AutoZip('myapp.zip', './build', './archive')
AutoZip({ outName: 'myapp.zip' })
Arguments are positional strings, not an options object. Breaking change in v1.2.0: outName moved to first argument.

Basic setup: import AutoZip (default), place as last plugin in vite.config, optional params for zip name, source folder, output folder.

// vite.config.ts import { defineConfig } from 'vite'; import AutoZip from 'vite-plugin-auto-zip'; export default defineConfig({ plugins: [ // AutoZip should be the last plugin AutoZip('myapp.zip', './dist', './dist') ] });
Debug
Known issues
breakingIn v1.2.0, the parameter order changed: outName is now the first parameter instead of the third.
fix
Update calls from AutoZip('./dist', 'dist.zip') to AutoZip('dist.zip', './dist') or use the new default: AutoZip() produces 'dist.zip' from './dist'.
affects: >=1.2.0
gotchaAutoZip must be the last plugin in the plugins array to ensure it runs after all other build steps.
fix
Always place AutoZip() as the last entry in the plugins array in vite.config.
affects: <2.0.0
gotchaThe plugin only runs in production mode (vite build), not during dev (vite dev).
fix
No change needed — this is by design. If you need zipping in dev, consider a different approach.
affects: <2.0.0
gotchaThe plugin uses the archiver package under the hood, but it is bundled — no extra install needed.
fix
No action required.
affects: <2.0.0
Errors
Common errors & fixes
Cannot find module 'vite-plugin-auto-zip'
Package not installed or typo in import path.
fix
Run 'npm install vite-plugin-auto-zip' and check import statement is correct.
AutoZip is not a function
Using named import instead of default import.
fix
Use 'import AutoZip from ...' instead of 'import { AutoZip } from ...'.
The plugin does not zip, no errors in console
Plugin runs only on production build, not dev server.
fix
Run 'vite build' to trigger the plugin.
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
vite-plugin-auto-zip — npm install vite-plugin-auto-zip · libregistry