Bugfix. Fix SSR pages filters. Remove dedicated API bundler, use SSR bundler for pages and api routes.
This commit is contained in:
@@ -66,22 +66,22 @@ export default function apiRoutesCTXArtifactTracker({ pages }: Params) {
|
||||
};
|
||||
});
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 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`);
|
||||
const elapsed = (performance.now() - build_start).toFixed(0);
|
||||
log.success(`API Routes [Built] in ${elapsed}ms`);
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -31,6 +31,7 @@ export default function esbuildCTXArtifactTracker({
|
||||
build.onStart(async () => {
|
||||
build_starts++;
|
||||
build_start = performance.now();
|
||||
|
||||
if (build_starts == MAX_BUILD_STARTS) {
|
||||
await buildOnstartErrorHandler();
|
||||
}
|
||||
@@ -74,12 +75,6 @@ export default function esbuildCTXArtifactTracker({
|
||||
} else {
|
||||
pagesSSRContextBundler();
|
||||
}
|
||||
|
||||
if (global.API_ROUTES_BUNDLER_CTX) {
|
||||
global.API_ROUTES_BUNDLER_CTX.rebuild();
|
||||
} else {
|
||||
apiRoutesContextBundler();
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -2,6 +2,7 @@ import { type Plugin } from "esbuild";
|
||||
import type { PageFiles } from "../../../types";
|
||||
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;
|
||||
@@ -56,7 +57,12 @@ export default function ssrCTXArtifactTracker({
|
||||
}
|
||||
}
|
||||
|
||||
post_build_fn?.({ artifacts });
|
||||
// post_build_fn?.({ artifacts });
|
||||
|
||||
// const elapsed = (performance.now() - build_start).toFixed(
|
||||
// 0,
|
||||
// );
|
||||
// log.success(`SSR [Built] in ${elapsed}ms`);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user