# FastAPI + build command example

Demonstrates the `-- <command>` feature: a build step runs automatically on startup and before each browser reload.

Here `build.py` concatenates all CSS files from `src/` into `static/bundle.css`. Swap it for any real build tool (`npm run build`, `npx tailwindcss`, etc.).

## Setup

```bash
pip install "asgi-autoreload[fastapi]" jinja2
```

## Run

```bash
fastapi-autoreload dev main.py --exclude static -- python build.py
```

Open http://127.0.0.1:8000, then edit `src/style.css` — the stylesheet rebuilds and the browser reloads automatically.

## With a real build tool

```bash
# Tailwind CSS
fastapi-autoreload dev main.py -- npx tailwindcss -i src/input.css -o static/output.css

# npm script
fastapi-autoreload dev main.py -- npm run build

# Watch specific directories only
fastapi-autoreload dev main.py --watch src --watch templates -- npm run build
```
