chore: cleanup

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei 2024-11-03 23:05:26 +08:00
parent 4e841964e6
commit 3bd6fab9ce
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
2 changed files with 1 additions and 23 deletions

View File

@ -2,30 +2,7 @@ import { mkdirSync } from "node:fs"
import fs from "node:fs/promises"
import path from "node:path"
// const fontDepsPath = require.resolve("@fontsource/sn-pro")
// const fontsDirPath = resolve(fontDepsPath, "../files")
// const fontsDir = readdirSync(fontsDirPath).filter(
// (name) => !name.endsWith(".woff2") && !name.includes("italic"),
// )
mkdirSync(path.join(__dirname, "../.generated"), { recursive: true })
// async function generateFontData() {
// const files = {} as Record<string, string>
// await Promise.all(
// fontsDir.map(async (file) => {
// const r = await fs.readFile(path.join(fontsDirPath, file))
// const base64 = r.toString("base64")
// files[file] = base64
// }),
// )
// writeFileSync(
// path.join(__dirname, "../.generated/fonts-data.ts"),
// `export default ${JSON.stringify(files, null, 2)}`,
// )
// }
async function generateIndexHtmlData() {
const indexHtml = await fs.readFile(path.join(__dirname, "../dist/index.html"), "utf-8")

View File

@ -102,6 +102,7 @@ async function safeInjectMetaToTemplate(
return document
}
}
async function injectMetaToTemplate(document: Document, req: FastifyRequest, res: FastifyReply) {
const injectMetadata = await injectMetaHandler(req, res).catch((err) => {
if (isDev) {