Prerequisites
Before building, ensure you have:- Node.js 20 or higher
- pnpm package manager (version 9)
- All required environment variables configured in
.env.local
Build Scripts Overview
The build process uses several npm scripts defined infrontend/package.json:12-19:
Building for Windows
Run the build command
Execute the dist command to create the production executable:Or using npm:This command:
- Builds the Next.js application with Turbopack
- Compiles the Electron main process using tsup
- Packages everything into a Windows installer using electron-builder
Building for Linux
The Linux build is configured in
package.json:197-203 to target the Development category and includes proper icon configuration.Build Configuration
The electron-builder configuration inpackage.json includes:
Application Settings
- Product Name: Tabby
- App ID: com.tabby.ai-keyboard
- ASAR Packaging: Enabled for code protection
Included Files
The build packages:- Electron build artifacts (
build/) - Next.js standalone output (
.next/standalone) - Static assets (
.next/static) - Public files (
public/) - Required native modules (
*.node,*.dll)
Windows NSIS Installer
Troubleshooting
Build Fails on Windows
If the build fails, ensure:- You have the latest Windows Build Tools installed
- Visual Studio C++ build tools are available
- All dependencies installed successfully with
pnpm install
Missing Dependencies
The postinstall script automatically runselectron-builder install-app-deps. If you encounter native module issues, try:
TypeScript Errors
Run type checking before building:tsc --noEmit to check for TypeScript errors without generating output files.