mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
enhancement(web): improve font loading performance and avoid page reflow (#1087)
* enhancement: improve font loading performance and avoid page reflow chore: get rid of postcss-import (we're not using it and it's not needed for tailwind) * fix indent
This commit is contained in:
parent
64f81a4614
commit
7b77ff766e
8 changed files with 38 additions and 19 deletions
|
@ -4,6 +4,12 @@ import { VitePWA } from "vite-plugin-pwa";
|
|||
import react from "@vitejs/plugin-react-swc";
|
||||
import svgr from "vite-plugin-svgr";
|
||||
|
||||
interface PreRenderedAsset {
|
||||
name: string | undefined;
|
||||
source: string | Uint8Array;
|
||||
type: 'asset';
|
||||
}
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default ({ mode }: ConfigEnv) => {
|
||||
// early load .env file
|
||||
|
@ -97,6 +103,16 @@ export default ({ mode }: ConfigEnv) => {
|
|||
build: {
|
||||
manifest: true,
|
||||
sourcemap: true,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
assetFileNames: (chunkInfo: PreRenderedAsset) => {
|
||||
if (chunkInfo.name === "Inter.var.woff2") {
|
||||
return "assets/[name][extname]";
|
||||
}
|
||||
return "assets/[name]-[hash][extname]";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue