(path: string)
| 23 | export * as markmap from 'markmap-lib'; |
| 24 | |
| 25 | async function loadFile(path: string) { |
| 26 | if (path.startsWith(ASSETS_PREFIX)) { |
| 27 | const relpath = path.slice(ASSETS_PREFIX.length); |
| 28 | return readFile(resolve(config.assetsDir, relpath), 'utf8'); |
| 29 | } |
| 30 | const res = await fetch(path); |
| 31 | if (!res.ok) throw res; |
| 32 | return res.text(); |
| 33 | } |
| 34 | |
| 35 | async function inlineAssets(assets: IAssets): Promise<IAssets> { |
| 36 | const [scripts, styles] = await Promise.all([ |