Deployment (packaging)
How to turn a working dae run setup into a distributable installer: what dae build does, how electron-builder.config.ts controls the output, and what to check when shipping auto-updates, crash reporting, or bundled worker scripts.
Building an installer
npx dae build [mac|win|linux]
This runs, in order:
- The renderer build (
npm run buildin the target project — for the playground this istsc --noEmit && vite build, producingdist/). - Bundling of
electron/main.ts+electron/preload.tswith esbuild. - Packaging via
electron-builder, usingelectron-builder.config.tsplusappId/appNamepulled fromelectron.config.ts— no need to duplicate app identity in both files.
The platform argument defaults to the current OS if omitted.
electron-builder.config.ts
Exports a default electron-builder Configuration. The playground's version:
import type { Configuration } from 'electron-builder';
const config: Configuration = {
directories: {
output: 'release',
},
files: ['dist/**/*', 'dist-electron/**/*'],
mac: { target: ['dmg'] },
win: { target: ['nsis'] },
linux: { target: ['AppImage'] },
};
export default config;
directories.output— where the packaged installer(s) land (release/here).files— which build outputs get bundled into the app (the renderer'sdist/and the bundled Electron sources'dist-electron/).mac/win/linux— target installer formats.dae buildpicks the section matching the requested/current platform.
Do not set appId/productName here — dae build passes those through automatically from electron.config.ts's appId/appName.
Shipping extra resources
Anything a processes.externalCommands or processes.utilityProcesses entry needs at runtime (a bundled executable, a worker script) must actually be placed in the packaged app by electron-builder.config.ts, typically via extraResources — resolve: 'app' / modulePath for these features resolve against resources/app/ in the packaged build, which is a real filesystem path only if the builder config actually copies the file there. See Processes configuration.
Auto-updates
autoUpdater.enabled: true in electron.config.ts turns on electron-updater-backed checks (autoUpdater.channel, autoDownload, autoInstallOnQuit, allowPrerelease, allowDowngrade). The updater is only active in production (app.isPackaged) — it does nothing when running under dae run. The renderer drives it via window.Electron.updater.checkForUpdate(), downloadUpdate(), quitAndInstall(), and on(event, callback).
Crash reporting
Off by default. Set crashReporter.enabled: true (+ optional submitURL, uploadToServer, companyName, extra) to start collecting native crash dumps. Omitting submitURL keeps dumps local-only, readable via window.Electron.crashReporter.getLastCrashReport(), without uploading anywhere.