@mandujs/core 0.9.27 → 0.9.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/bundler/build.ts +12 -5
package/package.json
CHANGED
package/src/bundler/build.ts
CHANGED
|
@@ -1118,12 +1118,23 @@ export async function buildClientBundles(
|
|
|
1118
1118
|
// 1. Hydration이 필요한 라우트 필터링
|
|
1119
1119
|
const hydratedRoutes = getHydratedRoutes(manifest);
|
|
1120
1120
|
|
|
1121
|
+
// 2. 출력 디렉토리 생성 (항상 필요 - 매니페스트 저장용)
|
|
1122
|
+
const outDir = options.outDir || path.join(rootDir, ".mandu/client");
|
|
1123
|
+
await fs.mkdir(outDir, { recursive: true });
|
|
1124
|
+
|
|
1125
|
+
// Hydration 라우트가 없어도 빈 매니페스트를 저장해야 함
|
|
1126
|
+
// (이전 빌드의 stale 매니페스트 참조 방지)
|
|
1121
1127
|
if (hydratedRoutes.length === 0) {
|
|
1128
|
+
const emptyManifest = createEmptyManifest(env);
|
|
1129
|
+
await fs.writeFile(
|
|
1130
|
+
path.join(rootDir, ".mandu/manifest.json"),
|
|
1131
|
+
JSON.stringify(emptyManifest, null, 2)
|
|
1132
|
+
);
|
|
1122
1133
|
return {
|
|
1123
1134
|
success: true,
|
|
1124
1135
|
outputs: [],
|
|
1125
1136
|
errors: [],
|
|
1126
|
-
manifest:
|
|
1137
|
+
manifest: emptyManifest,
|
|
1127
1138
|
stats: {
|
|
1128
1139
|
totalSize: 0,
|
|
1129
1140
|
totalGzipSize: 0,
|
|
@@ -1134,10 +1145,6 @@ export async function buildClientBundles(
|
|
|
1134
1145
|
};
|
|
1135
1146
|
}
|
|
1136
1147
|
|
|
1137
|
-
// 2. 출력 디렉토리 생성
|
|
1138
|
-
const outDir = options.outDir || path.join(rootDir, ".mandu/client");
|
|
1139
|
-
await fs.mkdir(outDir, { recursive: true });
|
|
1140
|
-
|
|
1141
1148
|
// 3. Runtime 번들 빌드
|
|
1142
1149
|
const runtimeResult = await buildRuntime(outDir, options);
|
|
1143
1150
|
if (!runtimeResult.success) {
|