| 1 | import type { PreparserSetup } from '@slidev/types' |
| 2 | import { injectPreparserExtensionLoader } from '@slidev/parser/fs' |
| 3 | import { loadSetups } from './load' |
| 4 | |
| 5 | export default function setupPreparser() { |
| 6 | injectPreparserExtensionLoader(async (roots: string[], headmatter: Record<string, unknown>, filepath: string, mode?: string) => { |
| 7 | const returns = await loadSetups<PreparserSetup>(roots, 'preparser.ts', [ |
| 8 | { filepath, headmatter, mode }, |
| 9 | ]) |
| 10 | return returns.flat() |
| 11 | }) |
| 12 | } |
| 13 |