Skip to main content
@moss-tools/md-indexer parses a Markdown (or VitePress) docs directory and syncs it to a Moss index in one call. Use it in CI to keep your search index current whenever docs change.

Installation

Peer dependency: VitePress ^1.0.0 (used to resolve config and parse markdown).

Environment setup

Usage

sync — build and upload in one step

The most common path: parse docs and push to Moss immediately.

buildJsonDocs — build the index without uploading

Useful for inspecting the output or caching it between steps.

createIndex — upload a pre-built index file

VitePress config resolution

The indexer calls vp.resolveConfig() on the path you pass to sync() or buildJsonDocs().
  • Config file present — if .vitepress/config.ts (or .js) exists, the indexer honours srcDir, markdown options, and all other VitePress settings.
  • No config file — VitePress zero-config mode: all .md files in the directory are auto-discovered and processed with default settings. No config file needed for simple doc trees.
If config resolution fails entirely (e.g. invalid path), the indexer throws: Could not resolve VitePress config in <path>.

CI example

Add a step to your pipeline that runs after docs are built: