From 284696b634ef31b9c4dbe2e5cf8ad0c4fb21cd0d Mon Sep 17 00:00:00 2001 From: yout <930222789@qq.com> Date: Fri, 10 Mar 2023 12:04:41 +0800 Subject: [PATCH] feat: support RegExp type proxy settings1 --- packages/core/src/htmlPlugin.ts | 1 + 1 file changed, 1 insertion(+) 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