{"id":22586,"library":"vite-plugin-auto-zip","title":"vite-plugin-auto-zip","description":"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.","status":"active","version":"1.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/webszy/vite-plugin-auto-zip","tags":["javascript","vite","plugin","zip files","typescript"],"install":[{"cmd":"npm install vite-plugin-auto-zip","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-auto-zip","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-auto-zip","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export, not named. TypeScript types are included.","wrong":"import { AutoZip } from 'vite-plugin-auto-zip'","symbol":"AutoZip","correct":"import AutoZip from 'vite-plugin-auto-zip'"},{"note":"CommonJS require gets the default export as a single function.","wrong":"const { AutoZip } = require('vite-plugin-auto-zip')","symbol":"autoZip (default)","correct":"const AutoZip = require('vite-plugin-auto-zip')"},{"note":"Arguments are positional strings, not an options object. Breaking change in v1.2.0: outName moved to first argument.","wrong":"AutoZip({ outName: 'myapp.zip' })","symbol":"config","correct":"AutoZip('myapp.zip', './build', './archive')"}],"quickstart":{"code":"// vite.config.ts\nimport { defineConfig } from 'vite';\nimport AutoZip from 'vite-plugin-auto-zip';\n\nexport default defineConfig({\n  plugins: [\n    // AutoZip should be the last plugin\n    AutoZip('myapp.zip', './dist', './dist')\n  ]\n});","lang":"typescript","description":"Basic setup: import AutoZip (default), place as last plugin in vite.config, optional params for zip name, source folder, output folder."},"warnings":[{"fix":"Update calls from AutoZip('./dist', 'dist.zip') to AutoZip('dist.zip', './dist') or use the new default: AutoZip() produces 'dist.zip' from './dist'.","message":"In v1.2.0, the parameter order changed: outName is now the first parameter instead of the third.","severity":"breaking","affected_versions":">=1.2.0"},{"fix":"Always place AutoZip() as the last entry in the plugins array in vite.config.","message":"AutoZip must be the last plugin in the plugins array to ensure it runs after all other build steps.","severity":"gotcha","affected_versions":"<2.0.0"},{"fix":"No change needed — this is by design. If you need zipping in dev, consider a different approach.","message":"The plugin only runs in production mode (vite build), not during dev (vite dev).","severity":"gotcha","affected_versions":"<2.0.0"},{"fix":"No action required.","message":"The plugin uses the archiver package under the hood, but it is bundled — no extra install needed.","severity":"gotcha","affected_versions":"<2.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'npm install vite-plugin-auto-zip' and check import statement is correct.","cause":"Package not installed or typo in import path.","error":"Cannot find module 'vite-plugin-auto-zip'"},{"fix":"Use 'import AutoZip from ...' instead of 'import { AutoZip } from ...'.","cause":"Using named import instead of default import.","error":"AutoZip is not a function"},{"fix":"Run 'vite build' to trigger the plugin.","cause":"Plugin runs only on production build, not dev server.","error":"The plugin does not zip, no errors in console"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}