# /build — Production Build

Run Next.js production build. Reports success/failure and bundle size.

## Usage

```
/build                     # Full production build
/build analyze             # Build + bundle analysis
/build standalone          # Build standalone output
```

**Examples:**
- `/build`
- `/build analyze`

## Workflow

### Default: Full Build
```bash
cd /Users/Asim/Desktop/mawidi_codex/mawidi-site && npm run build
```

### Bundle Analysis
```bash
cd /Users/Asim/Desktop/mawidi_codex/mawidi-site && npm run build:analyze
```

### Pre-build Checks
Before building, verify:
1. No TypeScript errors: `npx tsc --noEmit`
2. If TS errors exist, report them and ask user whether to proceed

### Post-build Report
After successful build, report:
- Build success/failure
- Total build time
- Page sizes (from Next.js build output)
- Any warnings from the build

## Output Format

```
BUILD RESULTS
=============
Status:   SUCCESS / FAILED
Duration: Xs

Route (app)                Size     First Load JS
----------------------------------------------
/                          X kB     Y kB
/[lang]/dashboard          X kB     Y kB
...

Total First Load JS: X kB
```

## Key Rules
- Always run from mawidi-site directory
- Set NODE_OPTIONS for memory: already configured in package.json scripts
- Report build warnings even on success
- If build fails, analyze the error and suggest fixes
