| | |
| | | } |
| | | } catch (err) { |
| | | trace(`\nFailed to process \`${fp}\``, err as Error) |
| | | process.exit(1) |
| | | throw err |
| | | } |
| | | } |
| | | |
| | |
| | | let res: ProcessedContent[] = [] |
| | | log.start(`Parsing input files using ${concurrency} threads`) |
| | | if (concurrency === 1) { |
| | | try { |
| | | const processor = createProcessor(transformers) |
| | | const parse = createFileParser(transformers, baseDir, fps, allSlugs, verbose) |
| | | res = await parse(processor) |
| | | } catch (error) { |
| | | log.end() |
| | | throw error |
| | | } |
| | | } else { |
| | | await transpileWorkerScript() |
| | | const pool = workerpool.pool("./quartz/bootstrap-worker.mjs", { |
| | |
| | | await pool.terminate() |
| | | } |
| | | |
| | | log.success(`Parsed ${res.length} Markdown files in ${perf.timeSince()}`) |
| | | log.end(`Parsed ${res.length} Markdown files in ${perf.timeSince()}`) |
| | | return res |
| | | } |