Skip to content

Commit

Permalink
feat: skip invalid ssr middleware in dev for worker mode (#12708)
Browse files Browse the repository at this point in the history
  • Loading branch information
bravepg authored Sep 20, 2024
1 parent 9e93e1a commit b34a372
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 b34a372

Please sign in to comment.