From 9ae7fe6eb03f59b007aa9870a83aa1411ebb68d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Wed, 25 Sep 2024 17:06:57 +0900 Subject: [PATCH] fix: ignore directive sourcemap error (#231) --- src/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/index.ts b/src/index.ts index 4eaa8b2..7ee93d3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -278,6 +278,14 @@ const silenceUseClientWarning = (userConfig: UserConfig): BuildOptions => ({ ) { return; } + // https://github.com/vitejs/vite/issues/15012 + if ( + warning.code === "SOURCEMAP_ERROR" && + warning.message.includes("resolve original location") && + warning.pos === 0 + ) { + return; + } if (userConfig.build?.rollupOptions?.onwarn) { userConfig.build.rollupOptions.onwarn(warning, defaultHandler); } else {