---
description: Web build conventions (separate from native and RN JS)
globs: web/**, packages/web/**
alwaysApply: false
---

# Web build

Web-only target. Does NOT share patterns with the RN/native side.
If you find yourself wanting to import from `src/` (the RN tree),
stop and ask — the answer is usually no.

> Adjust the globs to your repo's actual web path (e.g. `app/**`,
> `components/**` for a Next.js root layout).

## Stack assumptions (verify before assuming)

- Framework: <FILL IN — Next.js / Vite + React / RN Web>
- Routing: per the framework's convention
- Styling: <FILL IN — Tailwind / CSS Modules / styled-components>
- State: <FILL IN — React Query / Zustand / Redux Toolkit>

## Conventions

- React + hooks, TypeScript strict.
- Web-only APIs are fine here: `window`, `document`, `localStorage`,
  `IntersectionObserver`, etc.
- Server components / SSR (if Next.js): be deliberate about
  `'use client'` boundaries.
- Images: optimized via the framework's image component, not raw
  `<img>` for above-the-fold content.
- No `react-native` imports unless `react-native-web` is explicitly
  configured.

## Hard exclusions

- Never import from the RN `src/` tree unless there's an explicit
  shared package (e.g., `packages/shared/`).
- Never assume mobile code runs here. RN-only libraries will break
  the web build.
- Never use native bridge code or `Platform.OS` checks here.

## Verification

```
cd web && npm run build
```

Or for a quick check without building:

```
cd web && npm run typecheck
```

## What NOT to do

- Do not duplicate logic that already exists in a shared package —
  import it.
- Do not introduce a new state library if one is already in use.
- Do not commit `.next/`, `dist/`, or `build/` output.
