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';
3
3
import starlight from '@astrojs/starlight' ;
4
4
import mtasaStarlightThemePlugin from '@multitheftauto/starlight-theme-mtasa' ;
5
5
import { SITE_TITLE , SITE_URL } from './src/content.constants' ;
6
+ import fs from 'fs' ;
7
+ import path from 'path' ;
6
8
7
9
export default defineConfig ( {
8
10
site : SITE_URL ,
@@ -99,4 +101,21 @@ export default defineConfig({
99
101
] ,
100
102
} ) ,
101
103
] ,
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
+ }
102
121
} ) ;
You can’t perform that action at this time.
0 commit comments