wiki/quartz/worker.ts

26 lines
663 B
TypeScript
Raw Normal View History

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"
2023-06-04 13:37:43 -04:00
import { createFileParser, createProcessor } from "./processors/parse"
2023-08-16 22:09:11 -07:00
import { options } from "./util/sourcemap"
2023-06-04 12:35:45 -04:00
// only called from worker thread
2024-08-08 19:33:27 -07:00
export async function parseFiles(
buildId: string,
argv: Argv,
fps: FilePath[],
allSlugs: FullSlug[],
) {
const ctx: BuildCtx = {
2024-08-08 19:33:27 -07:00
buildId,
cfg,
argv,
2023-07-24 00:04:01 -07:00
allSlugs,
}
2023-07-24 00:04:01 -07:00
const processor = createProcessor(ctx)
const parse = createFileParser(ctx, fps)
2023-06-04 13:37:43 -04:00
return parse(processor)
2023-06-04 12:35:45 -04:00
}