Bugfix. Fix SSR pages filters. Remove dedicated API bundler, use SSR bundler for pages and api routes.

This commit is contained in:
2026-04-12 06:48:10 +01:00
parent 532d0d6b56
commit 84d490b189
21 changed files with 131 additions and 138 deletions
@@ -44,17 +44,21 @@ export default function apiRoutesCTXArtifactTracker({ pages }) {
url_path,
};
});
if (artifacts?.[0] && artifacts.length > 0) {
for (let i = 0; i < artifacts.length; i++) {
const artifact = artifacts[i];
if (artifact?.local_path &&
global.API_ROUTES_BUNDLER_CTX_MAP) {
global.API_ROUTES_BUNDLER_CTX_MAP[artifact.local_path] = artifact;
}
}
}
// const elapsed = (performance.now() - build_start).toFixed(0);
// log.success(`API Routes [Built] in ${elapsed}ms`);
// if (artifacts?.[0] && artifacts.length > 0) {
// for (let i = 0; i < artifacts.length; i++) {
// const artifact = artifacts[i];
// if (
// artifact?.local_path &&
// global.API_ROUTES_BUNDLER_CTX_MAP
// ) {
// global.API_ROUTES_BUNDLER_CTX_MAP[
// artifact.local_path
// ] = artifact;
// }
// }
// }
const elapsed = (performance.now() - build_start).toFixed(0);
log.success(`API Routes [Built] in ${elapsed}ms`);
});
},
};
@@ -48,12 +48,6 @@ export default function esbuildCTXArtifactTracker({ entryToPage, post_build_fn,
else {
pagesSSRContextBundler();
}
if (global.API_ROUTES_BUNDLER_CTX) {
global.API_ROUTES_BUNDLER_CTX.rebuild();
}
else {
apiRoutesContextBundler();
}
});
},
};
+6 -1
View File
@@ -1,6 +1,7 @@
import {} from "esbuild";
import grabArtifactsFromBundledResults from "../grab-artifacts-from-bundled-result";
import buildOnstartErrorHandler from "../build-on-start-error-handler";
import { log } from "../../../utils/log";
let build_start = 0;
let build_starts = 0;
const MAX_BUILD_STARTS = 2;
@@ -34,7 +35,11 @@ export default function ssrCTXArtifactTracker({ entryToPage, post_build_fn, }) {
artifact;
}
}
post_build_fn?.({ artifacts });
// post_build_fn?.({ artifacts });
// const elapsed = (performance.now() - build_start).toFixed(
// 0,
// );
// log.success(`SSR [Built] in ${elapsed}ms`);
}
});
},