diff --git a/packages/core/src/htmlPlugin.ts b/packages/core/src/htmlPlugin.ts
index d8282e8..e23e6af 100644
--- a/packages/core/src/htmlPlugin.ts
+++ b/packages/core/src/htmlPlugin.ts
@@ -337,6 +337,10 @@ function createRewire(
if (excludeBaseUrl === '/') {
return template
}
+ const isStatic = /^\/(?:[^/]+\/)*[^/]+$/.test(excludeBaseUrl)
+ if (isStatic) {
+ return pathname
+ }
const isApiUrl = proxyUrlKeys.some((item) =>
pathname.startsWith(path.resolve(baseUrl, item)),
)