From 6e77555351db7c53a0528c31871e66a688d9abd8 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Tue, 26 Nov 2024 13:47:03 +0700 Subject: [PATCH] Stop Svelte warning about self-closing HTML tags We'll fix the self-closing tags when we migrate to Svelte 5; in the meantime, we don't want these warnings to flood the compilation results and end up hiding other, more important, warnings. --- frontend/svelte.config.js | 1 + frontend/viewer/svelte.config.js | 1 + 2 files changed, 2 insertions(+) diff --git a/frontend/svelte.config.js b/frontend/svelte.config.js index 469f541e5e..214f94b1ab 100644 --- a/frontend/svelte.config.js +++ b/frontend/svelte.config.js @@ -4,6 +4,7 @@ import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; /** @type {import('@sveltejs/kit').Config} */ const config = { compilerOptions: { + warningFilter: (warning) => warning.code != 'element_invalid_self_closing_tag', enableSourcemap: true }, kit: { diff --git a/frontend/viewer/svelte.config.js b/frontend/viewer/svelte.config.js index 733b373777..09194e5a65 100644 --- a/frontend/viewer/svelte.config.js +++ b/frontend/viewer/svelte.config.js @@ -8,6 +8,7 @@ const postcssConfig = path.join(__dirname, 'postcss.config.cjs'); export default { compilerOptions: { + warningFilter: (warning) => warning.code != 'element_invalid_self_closing_tag', customElement: true, }, // Consult https://svelte.dev/docs#compile-time-svelte-preprocess