🐛 fix: strip manifest link in Vite dev to silence 404 warning (#14079)

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
<link rel="manifest"> tag via transformIndexHtml for web/mobile/desktop.
This commit is contained in:
Innei
2026-04-23 15:10:00 +08:00
committed by GitHub
parent cad10007ef
commit 4e31a33599
+8
View File
@@ -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*<link\s+rel="manifest"[^>]*>\s*/i, '\n '),
},
},
isDev &&
codeInspectorPlugin({
bundler: 'vite',