Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Jun 5, 2024
1 parent c0aa5c7 commit afdf4ec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/react-server/src/plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
type Plugin,
type PluginOption,
type ResolvedConfig,
Rollup,
type ViteDevServer,
build,
createLogger,
Expand Down Expand Up @@ -62,6 +63,8 @@ class PluginStateManager {
configEnv!: ConfigEnv;

buildType?: "scan" | "rsc" | "client" | "ssr";
buildContextServer?: Rollup.PluginContext;
buildContextBrowser?: Rollup.PluginContext;

routeToClientReferences: Record<string, string[]> = {};
routeManifest?: RouteManifest;
Expand Down Expand Up @@ -303,13 +306,12 @@ export function vitePluginReactServer(options?: {
apply: "build",
async buildStart(_options) {
if (!manager.buildType) {
console.log("▶▶▶ REACT SERVER BUILD (scan) [1/4]");
// console.log("▶▶▶ REACT SERVER BUILD (scan) [1/4]");
// manager.buildType = "scan";
// await build(reactServerViteConfig);

console.log("▶▶▶ REACT SERVER BUILD (server) [2/4]");
manager.buildType = "rsc";
manager.rscUseClientIds.clear();
await build(reactServerViteConfig);

console.log("▶▶▶ REACT SERVER BUILD (browser) [3/4]");
Expand Down

0 comments on commit afdf4ec

Please sign in to comment.