Offline builds
DocsLit can build your entire documentation site as a single HTML file. No server required — readers open the file in their browser by double-clicking it.
Build an offline site
This produces a dist/index.html file with everything inlined:
- All page content embedded in
window.__DOCSLIT_PAGES__ - The search index embedded in
window.__DOCSLIT_SEARCH_INDEX__ - All components and styles included inline
- Full navigation and search functionality
When to use offline builds
Offline vs static builds
| Feature | Static build | Offline build |
|---|---|---|
| Output | Multiple files in dist/ |
Single index.html |
| Server required | Yes (any static host) | No |
| SEO pages | Yes (docs/*.html) |
No |
| Sitemap | Yes | No |
| Search | Yes | Yes |
| llms.txt | Yes | No |
Size limits and large sites
Offline mode inlines every page, the search index, all components, and all styles into a single HTML file. That's exactly what makes it portable — and it's also what makes it scale poorly past a certain size.
| Site size | Typical offline file | Boot time | Recommendation |
|---|---|---|---|
| Up to ~50 pages | < 1 MB | Instant | Offline is fine |
| 50–200 pages | 1–5 MB | Sub-second on modern hardware | Offline still works well |
| 200+ pages, or > 5 MB | 5 MB+ | Noticeable JSON parse on open | Use static build instead |
docslit build --offline prints a warning when the output crosses ~5 MB or 200 pages, pointing to docslit build (the default) as the better fit for sites at that scale.