Fix api route caching issue
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import {} from "esbuild";
|
||||
import { log } from "../../../utils/log";
|
||||
import grabArtifactsFromBundledResults from "../grab-artifacts-from-bundled-result";
|
||||
let buildStart = 0;
|
||||
import buildOnstartErrorHandler from "../build-on-start-error-handler";
|
||||
let build_start = 0;
|
||||
let build_starts = 0;
|
||||
const MAX_BUILD_STARTS = 2;
|
||||
export default function ssrCTXArtifactTracker({ entryToPage, post_build_fn, }) {
|
||||
@@ -10,14 +10,14 @@ export default function ssrCTXArtifactTracker({ entryToPage, post_build_fn, }) {
|
||||
setup(build) {
|
||||
build.onStart(async () => {
|
||||
build_starts++;
|
||||
buildStart = performance.now();
|
||||
build_start = performance.now();
|
||||
if (build_starts == MAX_BUILD_STARTS) {
|
||||
// const error_msg = `SSR Build Failed. Please check all your components and imports.`;
|
||||
// log.error(error_msg);
|
||||
await buildOnstartErrorHandler();
|
||||
}
|
||||
});
|
||||
build.onEnd((result) => {
|
||||
if (result.errors.length > 0) {
|
||||
console.log("result.errors", result.errors);
|
||||
return;
|
||||
}
|
||||
const artifacts = grabArtifactsFromBundledResults({
|
||||
|
||||
Reference in New Issue
Block a user