From 1b671bf4075735ff8430e1ea24d561fb91f542f5 Mon Sep 17 00:00:00 2001 From: Padreug Date: Sun, 6 Sep 2026 19:24:15 +0200 Subject: [PATCH] build(machine): add a web-only build:web target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The machine app's `build` script runs vue-tsc, the Vite build, two electron tsc passes and an esbuild bundle. Serving the kiosk as a plain SPA needs only the middle one, and the electron passes drag in native-addon typings that a web build has no use for. Add `build:web` (just `vite build`) with a turbo task that still builds the workspace packages first via `dependsOn: ["^build"]`, so a consumer can run `pnpm build:web` at the repo root and get `apps/machine/dist`. `env: ["VITE_*"]` is declared on the task because the Vite vars are baked into the bundle at build time — without it turbo would happily serve a cached build produced under different env. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_013A6683cCHnQxFUosx1krY4 --- apps/machine/package.json | 1 + package.json | 1 + turbo.json | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/apps/machine/package.json b/apps/machine/package.json index 7f68db8..cefc699 100644 --- a/apps/machine/package.json +++ b/apps/machine/package.json @@ -15,6 +15,7 @@ "dev:vite": "vite", "electron:dev": "tsc -p electron/tsconfig.json && tsc -p electron/tsconfig.preload.json && electron dist-electron/main.js", "build": "vue-tsc --noEmit && vite build && tsc -p electron/tsconfig.json && tsc -p electron/tsconfig.preload.json && npx esbuild electron/fund-atm.ts --bundle --platform=node --format=cjs --external:better-sqlite3 --outfile=dist-electron/fund-atm.bundle.cjs", + "build:web": "vite build", "build:electron": "pnpm build && electron-builder", "preview": "vite preview", "typecheck": "vue-tsc --noEmit", diff --git a/package.json b/package.json index 1cf98b1..6499319 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "scripts": { "dev": "turbo dev", "build": "turbo build", + "build:web": "turbo build:web", "test": "turbo test", "lint": "turbo lint", "format": "prettier --write .", diff --git a/turbo.json b/turbo.json index d6d2fb5..a5a9376 100644 --- a/turbo.json +++ b/turbo.json @@ -5,6 +5,11 @@ "dependsOn": ["^build"], "outputs": ["dist/**", ".next/**", "!.next/cache/**"] }, + "build:web": { + "dependsOn": ["^build"], + "outputs": ["dist/**"], + "env": ["VITE_*"] + }, "dev": { "cache": false, "persistent": true