fix: Comic Shanns issues, new fonts structure (#8641)

This commit is contained in:
Marcel Mraz 2024-10-21 01:11:53 +03:00 committed by GitHub
parent 15ca182333
commit 61623bbeba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
279 changed files with 13267 additions and 488 deletions

View file

@ -25,14 +25,8 @@ export default defineConfig({
output: {
assetFileNames(chunkInfo) {
if (chunkInfo?.name?.endsWith(".woff2")) {
// TODO: consider splitting all fonts similar to Xiaolai
// fonts don't change often, so hash is not necessary
// put on root so we are flexible about the CDN path
if (chunkInfo.name.includes("Xiaolai")) {
return "[name][extname]";
} else {
return "[name]-[hash][extname]";
}
const family = chunkInfo.name.split("-")[0];
return `fonts/${family}/[name][extname]`;
}
return "assets/[name]-[hash][extname]";