mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-29 06:26:22 +00:00
25 lines
663 B
TypeScript
25 lines
663 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(
|
|
buildId: string,
|
|
argv: Argv,
|
|
fps: FilePath[],
|
|
allSlugs: FullSlug[],
|
|
) {
|
|
const ctx: BuildCtx = {
|
|
buildId,
|
|
cfg,
|
|
argv,
|
|
allSlugs,
|
|
}
|
|
const processor = createProcessor(ctx)
|
|
const parse = createFileParser(ctx, fps)
|
|
return parse(processor)
|
|
}
|