Skip to content

Commit

Permalink
fix(prod-server): ssr cache cant work in serve command
Browse files Browse the repository at this point in the history
  • Loading branch information
GiveMe-A-Name committed Jan 8, 2024
1 parent 494b290 commit 4b8e01a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/early-doors-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@modern-js/prod-server': patch
---

fix(prod-server): ssr cache can't work in `serve` command
fix(prod-server): ssr 缓存不能在 `serve` 指令中正常工作
3 changes: 2 additions & 1 deletion packages/server/prod-server/src/server/modernServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { IncomingMessage, ServerResponse, Server, createServer } from 'http';
import path from 'path';
import {
fs,
isProd,
isPromise,
isWebOnly,
mime,
Expand Down Expand Up @@ -165,7 +166,7 @@ export class ModernServer implements ModernServerInterface {
this.warmupSSRBundle();

// warmup cacheMod
cacheMod.loadServerCacheMod(this.pwd);
cacheMod.loadServerCacheMod(isProd() ? distDir : this.pwd);

await this.prepareFrameHandler();
await this.prepareLoaderHandler(usageRoutes, distDir);
Expand Down

0 comments on commit 4b8e01a

Please sign in to comment.