# Editor bundle vendor README

`editor.bundle.js` is a pre-built IIFE produced by esbuild from
`l4d2web/scripts/editor-src/`. It exposes `window.__editor.mount(textarea, opts)`.

## Rebuild

From repo root:

```
./l4d2web/scripts/build-editor.sh
```

This runs `npm install` inside `editor-src/` then `npx esbuild`. The
output overwrites `editor.bundle.js` and `editor.bundle.css` in this
directory and refreshes `editor.bundle.sha256`.

The build script uses `$TMPDIR/npm-cache` (override with the
`NPM_CACHE` env var) as the npm cache to avoid permission issues with
root-owned files in `~/.npm/_cacache/` from older npm versions.

## Pinned dependencies

See `l4d2web/scripts/editor-src/package.json` for semver ranges and
`package-lock.json` for the exact resolved versions. Run
`npm outdated` inside `editor-src/` to see upgrade candidates.

## Integrity

`editor.bundle.sha256` contains the hashes of the committed bundle.
If the bundle drifts from this hash in CI / review, the artifact was
rebuilt without committing the updated bundle.
