From 4e31a335998452028fa59b98dcba02ec83eac34b Mon Sep 17 00:00:00 2001 From: Innei Date: Thu, 23 Apr 2026 15:10:00 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20strip=20manifest=20link?= =?UTF-8?q?=20in=20Vite=20dev=20to=20silence=20404=20warning=20(#14079)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dev server does not serve /manifest.webmanifest, which causes a console 404 in the browser. Add a shared dev-only Vite plugin that removes the tag via transformIndexHtml for web/mobile/desktop. --- plugins/vite/sharedRendererConfig.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/vite/sharedRendererConfig.ts b/plugins/vite/sharedRendererConfig.ts index a263f6d429..a9aff257cd 100644 --- a/plugins/vite/sharedRendererConfig.ts +++ b/plugins/vite/sharedRendererConfig.ts @@ -143,6 +143,14 @@ export function sharedRendererPlugins(options: SharedRendererOptions) { viteNodeModuleStub(), vitePlatformResolve(options.platform), + isDev && { + name: 'lobe-dev-strip-manifest', + transformIndexHtml: { + order: 'pre' as const, + handler: (html: string) => html.replace(/\s*]*>\s*/i, '\n '), + }, + }, + isDev && codeInspectorPlugin({ bundler: 'vite',