From 6936d0059f03c0ba8656d2b4fb26db71329d445c Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 30 Aug 2024 13:56:49 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20refactor:=20Prevent=20Font=20Ass?= =?UTF-8?q?et=20Hashing=20in=20Vite=20Config=20(#3865)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/vite.config.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/vite.config.ts b/client/vite.config.ts index 6601eb32a8..837d092b9e 100644 --- a/client/vite.config.ts +++ b/client/vite.config.ts @@ -120,7 +120,12 @@ export default defineConfig({ }, entryFileNames: 'assets/[name].[hash].js', chunkFileNames: 'assets/[name].[hash].js', - assetFileNames: 'assets/[name].[hash].[ext]', + assetFileNames: (assetInfo) => { + if (assetInfo.name && /\.(woff|woff2|eot|ttf|otf)$/.test(assetInfo.name)) { + return 'assets/[name][extname]'; + } + return 'assets/[name].[hash][extname]'; + }, }, /** * Ignore "use client" waning since we are not using SSR