Skip to content

Commit

Permalink
fix: not generate ssr route runtime module when client build
Browse files Browse the repository at this point in the history
  • Loading branch information
Timeless0911 committed May 17, 2024
1 parent 75fbb8e commit 378f582
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/core/src/node/runtimeModule/routeData.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import { FactoryContext, RuntimeModuleID } from '.';

export async function routeVMPlugin(context: FactoryContext) {
const { routeService } = context;
const { routeService, isSSR } = context;

// client: The components of route is lazy loaded
if (!isSSR) {
return {
[RuntimeModuleID.RouteForClient]: routeService.generateRoutesCode(false),
};
}

return {
[RuntimeModuleID.RouteForClient]: routeService.generateRoutesCode(false),
[RuntimeModuleID.RouteForSSR]: routeService.generateRoutesCode(true),
Expand Down

0 comments on commit 378f582

Please sign in to comment.