From 1652dfe62abf45ec2521053e9e249dfabd92beb1 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 28 Aug 2026 22:57:08 +0200 Subject: [PATCH] chore(frontend): avoid loading CSS twice in vite dev mode (#39160) --- modules/public/manifest.go | 12 +++++++----- modules/public/manifest_test.go | 4 ++-- modules/public/vitedev.go | 7 +++++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/modules/public/manifest.go b/modules/public/manifest.go index 15fa8f16766..a99704bf3c6 100644 --- a/modules/public/manifest.go +++ b/modules/public/manifest.go @@ -142,17 +142,19 @@ func AssetURI(srcPath string) string { // AssetCSSLinks renders the tags for a JS entry's stylesheets: the entry's CSS plus the CSS // of every statically-imported chunk. Dev links devStylesheetSrc and lets the JS module inject the rest. func AssetCSSLinks(jsEntrySrc, devStylesheetSrc string) template.HTML { + if IsViteDevMode() { + // data-vite-dev-id makes Vite's HMR client skip injecting a duplicate