From e1ee2f6c71f67039b037af6dcc23b07935ffa7f1 Mon Sep 17 00:00:00 2001 From: Fredrik Strand Oseberg Date: Thu, 17 Aug 2023 15:04:41 +0200 Subject: [PATCH] fix: set css preload to false (#4524) After dependabot upgraded us to the new version of Vite, we started having failures on the preloading of CSS modules on certain lazy loaded modules. After investigation, it seems like Vite was adding another stylesheet into the head element when the lazy loaded modules were requested. These stylesheets had the wrong relative path when the assets were loaded from our CDN. We are not sure why this fails, but for now we are turning off cssPreloading. The impact is small, because we have few lazy loaded modules that preload the CSS. --- frontend/vite.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index c4ae6b1473..3d18766253 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -32,6 +32,7 @@ export default mergeConfig( outDir: 'build', assetsDir: 'static', modulePreload: false, + cssCodeSplit: false, }, server: { open: true,