Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:777genius Agent teams ai Electron Build

From Leeroopedia
Knowledge Sources
Domains Release, Build
Last Updated 2026-10-22 00:00 GMT

Overview

Pattern for building an Electron application with three targets (main, preload, renderer) using electron-vite with TypeScript path aliases, Tailwind CSS, and source map generation.

Description

Electron Build is the process of compiling the source tree into production bundles for the three Electron process targets. The `electron.vite.config.ts` file configures each target with its entry point, path aliases, and build options.

Key aspects:

  • Three targets: Main process (`src/main/`), preload bridge (`src/preload/`), and renderer (`src/renderer/`) each get separate Vite build configurations.
  • Path aliases: `@main/*`, `@renderer/*`, `@shared/*`, `@preload/*`, `@features/*` are resolved by the Vite config.
  • Tailwind CSS: PostCSS with Tailwind processes the renderer's CSS.
  • Source maps: Sentry source map generation is configured for production builds.
  • Output directories: Compiled bundles go to `out/main/`, `out/preload/`, `out/renderer/`.
  • TypeScript: The build uses TypeScript for type checking; `tsc` runs before the Vite build.

Usage

Use this principle when building a multi-process Electron application with Vite, especially when path aliases, CSS preprocessing, and source map generation are needed.

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment