Skip to content

Commit

Permalink
feat: worker 模式跳过 express 中间件
Browse files Browse the repository at this point in the history
  • Loading branch information
bravepg committed Sep 20, 2024
1 parent 9e93e1a commit d562734
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/preset-umi/src/features/ssr/ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit d562734

Please sign in to comment.