A Vite plugin that archives the build output into a ZIP or TAR file after a successful build. Current stable version 0.3.2, released sporadically with no fixed cadence. Only supports ESM imports. Key differentiator: integrates deeply with Vite's build lifecycle and uses archiver.js for archive creation, with options for output type, compression level, filename templates (using dayjs), and auto-open of archive directory. Requires Vite 6/7/8. Ships TypeScript types. Lightweight with no other runtime dependencies.
npm install vite-plugin-archiverVerified import paths — ran on the pinned version, not inferred.
Quick setup of vite-plugin-archiver with ZIP output, custom name template, and compression options.
Upgrade Vite to ^6.0.0 || ^7.0.0 || ^8.0.0; or pin plugin to v0.2.x for Vite 5 support.
Use import instead of require, and ensure your project is configured for ESM (e.g., "type": "module" in package.json).
Explicitly set build.outDir in Vite config, or ensure the output directory is generated by Vite.
Use dayjs-compatible format tokens: YYYY, MM, DD, HH, mm, ss, etc.
Set open: false in CI environments, or use an environment variable to conditionally enable it.
Switch to import syntax or set "type": "module" in package.json. If using TypeScript, ensure esModuleInterop is enabled.
Use ArchiverPlugin directly as a function: plugins: [ArchiverPlugin({...})]Install a compatible Vite version: npm install vite@^6.0.0
Use archiveType: 'tar' and optionally set archiveTarOptions.gzip: true.