Offline builds

Deployment3 min read|
|

DocsLit can build your entire documentation site as a self-contained folder. No server required — readers open index.html in their browser by double-clicking it. Pages load lazily for fast startup, and zero network requests are made.

Build an offline site

docslit build --offline

This produces a dist/ folder with everything needed to run offline:

  • index.html — the main entry point with all styles and components inline
  • pages/*.js — individual page content, loaded on demand as readers navigate
  • search-index.js — the search index, loaded when search is first used

All navigation, search, and theme switching work without a server or internet connection.

When to use offline builds

Offline vs static builds

FeatureStatic buildOffline build
OutputMultiple files in dist/Self-contained dist/ folder
Server requiredYes (any static host)No (file:// works)
SEO pagesYes (docs/*.html)No
SitemapYesNo
SearchYesYes
llms.txtYesNo
External requestsGoogle FontsNone
Static builds are better for production websites because they produce SEO-friendly pages and sitemaps. Offline builds are best for distributing docs in environments without internet access.

Security

Offline builds are hardened for safe use in restricted environments:

  • No inline event handlers — all interactivity uses event delegation instead of onclick/oninput attributes, making the output compatible with strict Content Security Policies
  • XSS protection — all user-facing interpolated values (page IDs, navigation text) are HTML-escaped before insertion into the DOM
  • No external requests — Google Fonts and other external resources are excluded; the site makes zero network requests
  • Self-contained — all styles, components, and application logic are bundled inline; only page content and the search index are loaded as separate local files

Custom output directory

docslit build --offline --out my-offline-docs