{"id":22958,"library":"vite-zipper","title":"Vite Zipper","description":"Vite Zipper (v0.3.15) is a Vite plugin that zips build outputs into a single archive file, streamlining deployment workflows. It supports custom output filenames, and TypeScript types are included. Requires Node.js >=18 and Vite ^7.0.0 as a peer dependency. Compared to alternatives like 'vite-plugin-zip-pack' or 'vite-plugin-zip-dist', it offers a simpler API with out-of-the-box TypeScript support and active maintenance on GitHub. Released under the MIT license, it follows a monthly release cadence.","status":"active","version":"0.3.15","language":"javascript","source_language":"en","source_url":"https://github.com/Posterior-AI/vite-zipper","tags":["javascript","vite","plugin","zip","export","project","vite-plugin","typescript"],"install":[{"cmd":"npm install vite-zipper","lang":"bash","label":"npm"},{"cmd":"yarn add vite-zipper","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-zipper","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: required for Vite plugin integration","package":"vite","optional":false}],"imports":[{"note":"ESM-only package; CommonJS require will throw. Named export from v0.3.0+.","wrong":"const viteZipper = require('vite-zipper')","symbol":"viteZipper","correct":"import { viteZipper } from 'vite-zipper'"},{"note":"TypeScript only; PluginOptions is a type, not a runtime value. Use import type to avoid errors in strict mode.","wrong":"import { PluginOptions } from 'vite-zipper'","symbol":"PluginOptions","correct":"import type { PluginOptions } from 'vite-zipper'"},{"note":"Default export also available, but named export is preferred. Using default with named destructure is unnecessary.","wrong":"import { default as viteZipper } from 'vite-zipper'","symbol":"default","correct":"import viteZipper from 'vite-zipper'"}],"quickstart":{"code":"// vite.config.ts\nimport { defineConfig } from 'vite';\nimport { viteZipper } from 'vite-zipper';\n\nexport default defineConfig({\n  plugins: [\n    viteZipper({ outputPath: 'dist', archiveName: 'my-site.zip' }),\n  ],\n});\n\n// After running 'vite build', outputs are zipped into 'dist/my-site.zip'.","lang":"typescript","description":"Shows how to configure vite-zipper in vite.config.ts to produce a zip archive of the build output."},"warnings":[{"fix":"Use import syntax and ensure Node.js >=18. For legacy projects, upgrade Node or use dynamic import().","message":"Package is ESM-only and requires Node.js >=18. Using require() will throw a runtime error.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Upgrade to v0.3.15 and update option names: old 'outputDir' is now 'outputPath', old 'fileName' is now 'archiveName'.","message":"In version 0.2.x, the plugin exported a default function under 'vite-zipper' but with different option names.","severity":"deprecated","affected_versions":">=0.2.0 <0.3.0"},{"fix":"If you need to zip during dev, consider using a different approach or triggering a build on demand.","message":"The plugin only runs during production builds; it does not affect the dev server or watch mode.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Ensure your build process cleans the output directory or uses unique archive names to avoid accidental overwrites.","message":"If the output archive already exists, it will be overwritten without warning. There is no conflict detection.","severity":"gotcha","affected_versions":">=0.3.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Change to import statement: import { viteZipper } from 'vite-zipper'; or use dynamic import: const { viteZipper } = await import('vite-zipper');","cause":"Using CommonJS require() on an ESM-only package.","error":"ERR_REQUIRE_ESM: require() of ES Module not supported"},{"fix":"Ensure you are using the named export: import { viteZipper } from 'vite-zipper'; or the default export: import viteZipper from 'vite-zipper';","cause":"Importing the plugin incorrectly, e.g., using default import with the wrong name, or importing a non-existent export.","error":"TypeError: viteZipper is not a function"},{"fix":"Upgrade Vite to version 7.x: npm install vite@7","cause":"Installed Vite version is older than required peer dependency.","error":"Error: The plugin 'vite-zipper' requires Vite ^7.0.0 but the current Vite version is x.y.z"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}