Files
chat/web/build.sh
clawbot 2a29f41aa8
All checks were successful
check / check (push) Successful in 57s
fix: bundle preact into SPA instead of leaving as external require
The esbuild config had --external:preact which told the bundler to leave
preact as a require() call instead of including it in the bundle. Since
the SPA loads app.js directly in the browser (no CDN or import map for
preact), the browser has no require() function and throws:

  Uncaught Error: Dynamic require of "preact" is not supported

Fix:
- Remove --external:preact from build.sh so preact is bundled into app.js
- Add --format=esm to output proper ESM instead of IIFE with CJS shims
- Update index.html to use <script type="module"> for ESM compatibility
- Remove the fallback build command (no longer needed)
- Rebuild dist/app.js with preact properly inlined

closes #48
2026-03-07 05:48:10 -08:00

685 B
Executable File