From eddf179a5c60fe9866514795262b82b6fbb8a8a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Wed, 18 Mar 2026 16:09:12 +0100 Subject: [PATCH] chore(astro): ignore false unused import build warning Suppress Astro's remote helper warning during Rollup builds when it points to astro/dist/assets/utils/index.js. --- astro.config.mjs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/astro.config.mjs b/astro.config.mjs index e029abb..c75afc4 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,6 +1,27 @@ import { defineConfig } from 'astro/config'; +const shouldIgnoreAstroUnusedImportWarning = (warning) => { + return ( + warning.code === 'UNUSED_EXTERNAL_IMPORT' && + warning.exporter === '@astrojs/internal-helpers/remote' && + warning.ids?.some((id) => id.includes('node_modules/astro/dist/assets/utils/index.js')) + ); +}; + export default defineConfig({ site: 'https://zblade.dev', output: 'static', + vite: { + build: { + rollupOptions: { + onwarn(warning, warn) { + if (shouldIgnoreAstroUnusedImportWarning(warning)) { + return; + } + + warn(warning); + }, + }, + }, + }, });