THE GITHTML FIELD GUIDE
Build and inspect a VitePress documentation artifact locally
Use the project's installed VitePress version and build script to generate production output, then inspect that output through the documented local preview. Check important pages and dependencies separately from the development server. A generated directory is a website artifact, not automatically a single self-contained document or a guarantee that every interactive feature works when opened as a file.
Read the project's scripts before choosing commands
Locate package metadata and identify the documentation root, build script, preview script, and output directory. Do not assume every repository uses the same folder layout. Use the package manager and dependency versions already declared by the project rather than installing an unrelated latest release globally. Inspect the commands for custom hooks or data-loading steps before executing an unfamiliar build. Documentation builds can run project code, so use an appropriate environment without unnecessary credentials. Record the source revision and configuration that produced the artifact. This makes a later review meaningful when the website and source tree have both changed.
Build and preview the actual production output
The sample uses common script names, but run them only when they exist in the project's package file. Check the build result and diagnostics before opening the preview. Visit a representative landing page, nested reference, code example, and image-bearing page. Compare their content with the source and watch for runtime-only components whose output differs from the development view. Do not use the preview server's success as evidence that an individual HTML file contains all its assets. Inspect the output directory and identify which resources are separate. Keep publishing or deployment out of this local review unless it is separately authorized.
npm run docs:build
npm run docs:previewChoose a reading artifact based on verified requirements
If the goal is a hosted documentation site, validate routes, assets, and interactive features through the intended serving model. If the goal is a portable reading copy, determine which content must be extracted or separately exported into a simpler document. Do not promise that search, client navigation, or remote widgets will work in every file reader. For gitHtml, the committed HTML is the input, not the Markdown source or a build command. Test the specific artifact and settings readers will use. Preserve the full production directory when reviewing the site as a site, and label any simplified reading copy as a separate export with its own limits.
- Inspect existing scripts, dependency versions, documentation root, and custom build hooks.
- Run the maintained local build and preview scripts rather than inventing a new pipeline.
- Check representative production pages and inventory separate resources.
- Distinguish a website artifact from a single-file reading copy before sharing it.
Sources and further reading
AI-assisted writing with source-linked guidance and illustrative examples. Read our editorial approach or report a correction.