File tree 2 files changed +12
-0
lines changed
packages/server/core/src/adapters/node/plugins
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @modern-js/server-core ' : patch
3
+ ---
4
+
5
+ chore: ` getServerManifest ` should run first on ` prepare `
6
+ chore: ` getServerManifest ` 应该在 ` prepare ` 时运行
Original file line number Diff line number Diff line change 9
9
ROUTE_MANIFEST_FILE ,
10
10
SERVER_BUNDLE_DIRECTORY ,
11
11
compatibleRequire ,
12
+ isProd ,
12
13
} from '@modern-js/utils' ;
13
14
import type {
14
15
Middleware ,
@@ -148,6 +149,11 @@ export const injectResourcePlugin = (): ServerPlugin => ({
148
149
async prepare ( ) {
149
150
const { middlewares, routes, distDirectory : pwd } = api . useAppContext ( ) ;
150
151
152
+ // In Production, should warmup server bundles on prepare.
153
+ if ( isProd ( ) ) {
154
+ getServerManifest ( pwd , routes || [ ] , console ) ;
155
+ }
156
+
151
157
middlewares . push ( {
152
158
name : 'inject-server-manifest' ,
153
159
You can’t perform that action at this time.
0 commit comments