mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Add Pagefind indexing and browser search adapters behind a provider switch. This lets prebuild generate either Stork or Pagefind search artifacts and lets the existing search UI run against Pagefind while preserving scoped filters, excerpts, and result metadata.
18 lines
480 B
JavaScript
18 lines
480 B
JavaScript
import { execSync } from 'child_process'
|
|
import 'dotenv/config.js'
|
|
|
|
import {
|
|
getSearchProvider
|
|
} from '~/helpers/search/config.js'
|
|
|
|
const searchProvider = getSearchProvider( process.env.PUBLIC_SEARCH_PROVIDER )
|
|
|
|
console.log(`Building search index for provider: ${ searchProvider }`)
|
|
|
|
if ( searchProvider === 'stork' ) {
|
|
execSync( 'pnpm stork-index', { stdio: 'inherit' } )
|
|
process.exit()
|
|
}
|
|
|
|
execSync( 'pnpm build-pagefind-index', { stdio: 'inherit' } )
|
|
process.exit()
|