# electron-builder + Vite Packaging Fix

> Your Electron zip is 400MB because electron-builder is packing its own previous output. Fix it with one config change.

electron-builder + Vite Packaging Fix is a paid AI agent skill on Agensi by ZyloTech, in Frontend & Web Apps. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $4.99 (one-time purchase)
- Creator: [ZyloTech](https://www.agensi.io/creators/zylotech)
- Category: [Frontend & Web Apps](https://www.agensi.io/skills/frontend-web-apps)
- Version: 1.0
- Last updated: 2026-10-18
- Security: scan passed (2026-10-18); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/electron-builder-vite-packaging-fix
- Tags: web-design, devops, testing, electron-builder, vite, macos-builds, packaging, electron

## About this skill

electron-builder writes to `dist/` by default, and so does Vite. If `build.files` includes `"dist/**/*"`, every build packs the previous
  build's artifacts into `app.asar`. Nothing errors; the package just keeps growing. In the real case behind this skill, 433MB and 489MB
  zips became a 203MB universal macOS build and a 138MB Windows x64 build.

  What your agent does with it:

  - Recognises the symptoms: a huge `app.asar`, zips nested inside the mac zip, Intel Macs that never open the app.
  - Applies a working build config: a separate `release/` output, a universal macOS target, and a Windows x64 zip built on macOS without
  wine.
  - Explains ad-hoc signing without an Apple Developer ID, and what buyers will see in Gatekeeper.
  - Verifies the result with five commands: asar size, architectures, codesign, asar contents and a launch check.

  What's inside: one SKILL.md. It changes only electron-builder configuration and ships no scripts.

  Compatibility: plain SKILL.md, no scripts. Your agent needs a shell to edit package.json, run the build and run the checks; the checks
  use macOS tools (ditto, lipo, codesign) and npx. Written from a real build with electron-builder 26 and Vite on an Apple Silicon Mac.

## Requires

- Node.js
- asar

## Known limitations

Covers electron-builder with Vite and zip targets for macOS and Windows. It does not cover notarization with an Apple Developer ID, DMG or installer targets, Linux builds, or auto-update. `!node_modules/**` is safe only when Vite bundles every renderer dependency and the main process imports nothing beyond electron and Node built-ins. Written against electron-builder 26.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the electron-builder + Vite Packaging Fix skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Why is my Electron app so large?

If electron-builder and Vite both write to dist/ and build.files includes dist/**, each build packs the previous build's artifacts into app.asar. The skill moves builder output to release/ and shows how to confirm the asar is small again.

### Why won't my app open on Intel Macs?

electron-builder targets the host architecture, so a build on Apple Silicon is arm64-only. The skill switches the mac target to universal and checks both architectures with lipo.

### Do I need an Apple Developer ID?

No. Without one the app is ad-hoc signed and launches, but buyers must approve it once in System Settings > Privacy & Security. Notarization is not covered.

### Can I build the Windows version on a Mac?

Yes. The Windows x64 zip target builds on macOS without wine with electron-builder 26.

### What's included?

One SKILL.md with the symptoms, the build config, signing notes and five verification commands. No scripts

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
