diff --git a/packages/core/src/htmlPlugin.ts b/packages/core/src/htmlPlugin.ts
index d8282e8..eab433e 100644
--- a/packages/core/src/htmlPlugin.ts
+++ b/packages/core/src/htmlPlugin.ts
@@ -338,6 +338,7 @@ function createRewire(
return template
}
const isApiUrl = proxyUrlKeys.some((item) =>
+ item.startsWith('^') && new RegExp(item).test(pathname) ||
pathname.startsWith(path.resolve(baseUrl, item)),
)
return isApiUrl ? excludeBaseUrl : template