# Export Standalone

> Bundle an HTML artifact into a single self-contained file with all CSS/JS/images inlined as data URLs. Requires `monolith` CLI (brew install monolith).

- Skill: `bluzir/export-standalone` (Agent Skill)
- Install (CLI): `npx skillmds@latest add bluzir/export-standalone`
- Raw SKILL.md: https://api.skillmd.com/api/skills/bluzir/export-standalone/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: bluzir (https://skillmd.com/u/bluzir)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/bluzir/export-standalone

---


# Export Standalone

Produce a single HTML file that works offline (no external dependencies). Uses `monolith` — a Rust CLI that inlines everything.

## Preflight

1. `Bash(which monolith)` — check installed. If missing:
   - Tell user: "`monolith` not found. Install with `brew install monolith` (macOS) and rerun."
   - Stop.

## Steps

1. Resolve paths:
   - `$0` = input HTML (required)
   - `$1` = output HTML (default: `<input>-standalone.html`)
   - `Bash(mkdir -p $(dirname <output>))` if needed

2. Run monolith:
   ```
   Bash(monolith "<input>" --isolate --no-metadata -o "<output>")
   ```
   Flags:
   - `--isolate` — CSP to prevent any remote resource loads after bundling
   - `--no-metadata` — strip `<!-- saved from ... -->` metadata

3. Report:
   - `Bash(stat -f%z "<output>")` or `Bash(ls -la "<output>")` for size
   - "Bundled `<input>` → `<output>` (`<size>` KB). Works offline."

## Tradeoffs

- Pros: single file, drop in email/chat, no CDN dependency, survives archive
- Cons: larger file size (5-10× original), no HMR, fonts often inlined as base64 (bigger)
- Interactivity preserved (React + Babel still run at load time), but network fetches fail by design

