From d562734cf194a6f9784bb71e702b445f6e46c8f2 Mon Sep 17 00:00:00 2001 From: bravepg Date: Fri, 20 Sep 2024 09:40:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20worker=20=E6=A8=A1=E5=BC=8F=E8=B7=B3?= =?UTF-8?q?=E8=BF=87=20express=20=E4=B8=AD=E9=97=B4=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/preset-umi/src/features/ssr/ssr.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/preset-umi/src/features/ssr/ssr.ts b/packages/preset-umi/src/features/ssr/ssr.ts index 4d18a42da49b..22d0da952d32 100644 --- a/packages/preset-umi/src/features/ssr/ssr.ts +++ b/packages/preset-umi/src/features/ssr/ssr.ts @@ -103,6 +103,10 @@ export default (api: IApi) => { api.addMiddlewares(() => [ async (req, res, next) => { + if (serverBuildTarget === 'worker') { + return next(); + } + const modulePath = absServerBuildPath(api); if (existsSync(modulePath)) { delete require.cache[modulePath];