# Build

Generate assets and work with watch mode.

```bash
./nimbly build      # full build: Tailwind + CSS + JS + i18n
npm run build       # same build, direct npm form
npm run build:tw    # build Tailwind once
npm run build:css   # build CSS (esbuild)
npm run build:js    # build JS (esbuild)
npm run build:text  # merge .po translation files
./nimbly up         # start the local Docker environment at http://localhost
```

Built files go to `ext/static/`. Always run build after changing CSS, JS, or Tailwind classes.

## Watch mode

```bash
./nimbly watch
```

Runs one full build, then keeps assets live during development:

- **Tailwind** - watches all `*.tpl` files in `core/` and `ext/` and rebuilds `css/tw/out.css` on any class change
- **CSS** - esbuild watches `css/index.css` and its imports (including `css/tw/out.css`); rebuilds `ext/static/app.css` whenever Tailwind or the CSS source changes
- **JS** - esbuild watches `js/index.jsx` and rebuilds `ext/static/app.js`
- **Text** - polls `text.po` files every 2 s and reruns `merge-text-po.mjs` on change

`ext/static/app.version` is updated after every rebuild to preserve cache busting, and `ext/static/app.core` records the core commit the assets were built from (commit both with the assets). Press `Ctrl+C` to stop.

---
