https://github.com/noxify/renoun-search-index.git
A standalone tool to generate JSON search indexes for local full-text search implementations (e.g., with Orama).
This project extracts structured data from MDX files and generates a searchable index that can be consumed by client-side search libraries. The implementation is inspired by and based on Fumadocs' excellent work โ huge thanks to the team!
The goal was to generate search index data based on the existing Renoun collection implementation. Initially, I explored using an internal API endpoint to leverage Next.js's runtime context, avoiding the need for component mocking. However, I ultimately switched to a standalone approach for greater flexibility, making it easier to adapt to other frameworks in the future (e.g., migrating from Next.js to Waku).
Since MDX files may directly import React components, we need to mock them during the build process to prevent runtime errors.
The current mocking configuration can be found in src/loaders/component-mock-loader.mjs.
To generate the search index:
pnpm install
pnpm generate:search
The generated JSON file can then be consumed by your search implementation.