update: clean up debug logging code

pull/4660/head
Yuxuan Zhang 6 months ago
parent d33f6ffb28
commit fb5dbb2e72
No known key found for this signature in database
GPG Key ID: 6910B04F3351EF7D

@ -92,12 +92,16 @@ function getExtraConfigs(path: string): SiteData[] {
segments.pop() segments.pop()
} }
// debug info // debug info
const summaryTitle = `Extra Configs for ${path}:` if (inBrowser) {
const summary = configs.map((c, i) => ` ${i + 1}. ${(c as any).__module__}`) const summaryTitle = `Config Layers for ${path}:`
summary.push(` ${summary.length + 1}. .vitepress/config (root)`) const summary = configs.map(
console.info( (c, i) => ` ${i + 1}. ${(c as any).__module__}`
[summaryTitle, ''.padEnd(summaryTitle.length, '='), ...summary].join('\n') )
) summary.push(` ${summary.length + 1}. .vitepress/config (root)`)
console.debug(
[summaryTitle, ''.padEnd(summaryTitle.length, '='), ...summary].join('\n')
)
}
return configs return configs
} }
@ -160,8 +164,6 @@ export function initData(route: Route): VitePressData {
export function useData<T = any>(): VitePressData<T> { export function useData<T = any>(): VitePressData<T> {
const data = inject(dataSymbol) const data = inject(dataSymbol)
;(window as any).stackView = stackView
;(window as any).data = data
if (!data) { if (!data) {
throw new Error('vitepress data not properly injected in app') throw new Error('vitepress data not properly injected in app')
} }

Loading…
Cancel
Save