File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ import { defineConfig } from 'astro/config';
33import starlight from '@astrojs/starlight' ;
44import mtasaStarlightThemePlugin from '@multitheftauto/starlight-theme-mtasa' ;
55import { SITE_TITLE , SITE_URL } from './src/content.constants' ;
6+ import fs from 'fs' ;
7+ import path from 'path' ;
68
79export default defineConfig ( {
810 site : SITE_URL ,
@@ -99,4 +101,21 @@ export default defineConfig({
99101 ] ,
100102 } ) ,
101103 ] ,
104+
105+ vite : {
106+ plugins : [
107+ {
108+ name : 'override-pagefind-config' ,
109+ closeBundle : async ( ) => {
110+ const configPath = path . join ( 'dist' , 'pagefind' , 'pagefind.json' ) ;
111+
112+ if ( fs . existsSync ( configPath ) ) {
113+ let config = JSON . parse ( fs . readFileSync ( configPath , 'utf-8' ) ) ;
114+ config . source = 'pages' ;
115+ fs . writeFileSync ( configPath , JSON . stringify ( config ) ) ;
116+ }
117+ } ,
118+ } ,
119+ ] ,
120+ }
102121} ) ;
You can’t perform that action at this time.
0 commit comments