finish path refactoring, add sourcemap + better trace support
This commit is contained in:
@ -19,6 +19,7 @@ import popoverStyle from '../components/styles/popover.scss'
|
||||
import { StaticResources } from "../resources"
|
||||
import { QuartzLogger } from "../log"
|
||||
import { googleFontHref } from "../theme"
|
||||
import { trace } from "../trace"
|
||||
|
||||
function addGlobalPageResources(cfg: GlobalConfiguration, staticResources: StaticResources, componentResources: ComponentResources) {
|
||||
staticResources.css.push(googleFontHref(cfg.theme))
|
||||
@ -110,7 +111,7 @@ export async function emitContent(contentFolder: string, output: string, cfg: Qu
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(chalk.red(`Failed to emit from plugin \`${emitter.name}\`: `) + err)
|
||||
trace(`Failed to emit from plugin \`${emitter.name}\``, err as Error)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import workerpool, { Promise as WorkerPromise } from 'workerpool'
|
||||
import { QuartzTransformerPluginInstance } from '../plugins/types'
|
||||
import { QuartzLogger } from '../log'
|
||||
import chalk from 'chalk'
|
||||
import { trace } from '../trace'
|
||||
|
||||
export type QuartzProcessor = Processor<MDRoot, HTMLRoot, void>
|
||||
export function createProcessor(transformers: QuartzTransformerPluginInstance[]): QuartzProcessor {
|
||||
@ -101,7 +102,7 @@ export function createFileParser(transformers: QuartzTransformerPluginInstance[]
|
||||
console.log(`[process] ${fp} -> ${file.data.slug}`)
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(chalk.red(`\nFailed to process \`${fp}\`: `) + err)
|
||||
trace(`\nFailed to process \`${fp}\``, err as Error)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user