Fix API bundler. Use new esbuild context builder for it.

This commit is contained in:
2026-04-11 12:06:53 +01:00
parent c4f7cf9164
commit 814a289460
30 changed files with 465 additions and 15 deletions
@@ -3,6 +3,7 @@ import { log } from "../../../utils/log";
import grabArtifactsFromBundledResults from "../grab-artifacts-from-bundled-result";
import pagesSSRContextBundler from "../pages-ssr-context-bundler";
import buildOnstartErrorHandler from "../build-on-start-error-handler";
import apiRoutesContextBundler from "../api-routes-context-bundler";
let build_start = 0;
let build_starts = 0;
const MAX_BUILD_STARTS = 2;
@@ -46,6 +47,12 @@ export default function esbuildCTXArtifactTracker({ entryToPage, post_build_fn,
else {
pagesSSRContextBundler();
}
if (global.API_ROUTES_BUNDLER_CTX) {
global.API_ROUTES_BUNDLER_CTX.rebuild();
}
else {
apiRoutesContextBundler();
}
});
},
};