#!/bin/sh set -e cd "$(dirname "$0")" # The esbuild that yarn.lock pins, which yarn install puts in node_modules if [ ! -x node_modules/.bin/esbuild ]; then echo "esbuild not found. Install it: yarn install --frozen-lockfile" exit 1 fi mkdir -p dist # Build JS bundle — preact must be bundled (no CDN/external loader) node_modules/.bin/esbuild src/app.jsx \ --bundle \ --minify \ --format=esm \ --jsx-factory=h \ --jsx-fragment=Fragment \ --define:process.env.NODE_ENV=\"production\" \ --outfile=dist/app.js # Copy static files cp src/index.html dist/index.html cp src/style.css dist/style.css echo "Build complete: web/dist/"