add flamethrower router

This commit is contained in:
Jacky Zhao 2023-06-07 22:38:45 -07:00
parent 317cce9314
commit 59109a8c1d
5 changed files with 16 additions and 9 deletions
quartz/plugins

View file

@ -4,6 +4,7 @@ import { StaticResources } from '../resources'
import { googleFontHref, joinStyles } from '../theme'
import { EmitCallback, PluginTypes } from './types'
import styles from '../styles/base.scss'
import spaRouterScript from '../components/scripts/spa.inline'
export type ComponentResources = {
css: string[],
@ -31,6 +32,10 @@ export function emitComponentResources(cfg: GlobalConfiguration, resources: Stat
afterDOMLoaded: []
}
if (cfg.enableSPA) {
componentResources.afterDOMLoaded.push(spaRouterScript)
}
for (const component of allComponents) {
const { css, beforeDOMLoaded, afterDOMLoaded } = component
if (css) {