Files
neoirc/web/build.sh
T
clawbot 311688ae2c
check / check (push) Waiting to run
Build the web front end with yarn (closes #117)
web/yarn.lock replaces web/package-lock.json. yarn import converted
it, so it locks the same package versions with the same integrity
hashes. The web-builder stage pins yarn 1.22.22, the version
script/bootstrap pins, by its sha512 through corepack, and installs
with yarn install --frozen-lockfile. web/build.sh runs the esbuild
that yarn installed rather than npx or an esbuild found on the PATH.

Model: opus-5-5
2026-10-06 22:20:09 +00:00

28 lines
652 B
Bash
Executable File

#!/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/"