# Building the aisthetix Virtual Try-On widget

The storefront widget shipped as `assets/widget.js` + `assets/widget.css` is built
from the React + TypeScript source in this `widget-src/` directory. All runtime
dependencies are MIT-licensed (React, React DOM).

## Prerequisites

- Node.js 18+ and npm.

## Build

```bash
cd widget-src
npm ci            # clean, lockfile-exact install
npm run build     # emits ../assets/widget.js and ../assets/widget.css
```

`npm run build` runs Vite (`vite build`) and writes the bundle into the plugin's
`assets/` directory. `emptyOutDir` is off, so the hand-authored
`assets/bootstrap.js` loader is preserved. The build is reproducible: the same
source + lockfile produce the same `assets/widget.js` / `assets/widget.css`.

## Other scripts

```bash
npm run typecheck # strict TypeScript check (tsc --noEmit)
npm test          # unit tests (Vitest)
npm run dev       # rebuild on change while developing
```
