public_notes/quartz/worker.ts

20 lines
622 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-05 02:37:43 +09:00
import { createFileParser, createProcessor } from "./processors/parse"
2023-08-17 14:09:11 +09:00
import { options } from "./util/sourcemap"
2023-06-05 01:35:45 +09:00
// only called from worker thread
export async function parseFiles(argv: Argv, fps: FilePath[], allSlugs: FullSlug[]) {
const ctx: BuildCtx = {
cfg,
argv,
2023-07-24 16:04:01 +09:00
allSlugs,
}
2023-07-24 16:04:01 +09:00
const processor = createProcessor(ctx)
const parse = createFileParser(ctx, fps)
2023-06-05 02:37:43 +09:00
return parse(processor)
2023-06-05 01:35:45 +09:00
}