This repository has been archived on 2024-09-06. You can view files and clone it, but cannot push or open issues or pull requests.
quartz-wiki/quartz/worker.ts
2024-01-10 14:39:54 +08:00

20 lines
622 B
TypeScript

import sourceMapSupport from "source-map-support"
sourceMapSupport.install(options)
import cfg from "../quartz.config"
import { Argv, BuildCtx } from "./util/ctx"
import { FilePath, FullSlug } from "./util/path"
import { createFileParser, createProcessor } from "./processors/parse"
import { options } from "./util/sourcemap"
// only called from worker thread
export async function parseFiles(argv: Argv, fps: FilePath[], allSlugs: FullSlug[]) {
const ctx: BuildCtx = {
cfg,
argv,
allSlugs,
}
const processor = createProcessor(ctx)
const parse = createFileParser(ctx, fps)
return parse(processor)
}