import path from 'path'; import type { LoadContext, Plugin } from '@docusaurus/types'; interface SearchPluginOptions { providersModule: string; } export default function docuservixSearchPlugin( _ctx: LoadContext, options: SearchPluginOptions, ): Plugin { return { name: 'docuservix-search', getThemePath() { return path.resolve(__dirname, './theme'); }, getTypeScriptThemePath() { return path.resolve(__dirname, './theme'); }, configureWebpack() { return { resolve: { alias: { '@docuservix-search/config': options.providersModule, }, }, }; }, async contentLoaded({ actions }) { actions.addRoute({ path: '/search', component: '@theme/SearchPage', exact: true, }); actions.addRoute({ path: '/chat', component: '@theme/ChatPage', exact: true, }); }, }; }