hatch-surf/node_modules/next/dist/esm/build/after-production-compile.js
Riley Zhang df378d33ef
Some checks failed
CI / go (push) Waiting to run
CI / docker (push) Waiting to run
CI / lint-go (push) Waiting to run
CI / lint-docs (push) Waiting to run
CI / check-paperclip (push) Waiting to run
Deploy static site / Deploy to GitHub Pages (push) Has been cancelled
Deploy static site / Deploy via Docker to hatch.surf (push) Has been cancelled
Merge GitHub main into Gitea repo (allow unrelated histories)
Resolved conflicts by taking GitHub versions for:
- .dockerignore, .gitignore, Dockerfile, README.md, docker-compose.yml

Kept deploy.sh updated to:
- Pull from GitHub (primary source)
- Push to Gitea (push-mirror)
- Build from site/ directory (GitHub structure)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-25 05:20:46 +02:00

42 lines
1.7 KiB
JavaScript

import * as Log from './output/log';
import createSpinner from './spinner';
import isError from '../lib/is-error';
import { EVENT_BUILD_FEATURE_USAGE } from '../telemetry/events/build';
import { hrtimeBigIntDurationToString } from './duration-to-string';
// TODO: refactor this to account for more compiler lifecycle events
// such as beforeProductionBuild, but for now this is the only one that is needed
export async function runAfterProductionCompile({ config, buildSpan, telemetry, metadata }) {
const run = config.compiler.runAfterProductionCompile;
if (!run) {
return;
}
telemetry.record([
{
eventName: EVENT_BUILD_FEATURE_USAGE,
payload: {
featureName: 'runAfterProductionCompile',
invocationCount: 1
}
}
]);
const afterBuildSpinner = createSpinner('Running next.config.js provided runAfterProductionCompile');
try {
const startTime = process.hrtime.bigint();
await buildSpan.traceChild('after-production-compile').traceAsyncFn(async ()=>{
await run(metadata);
});
const duration = process.hrtime.bigint() - startTime;
const formattedDuration = hrtimeBigIntDurationToString(duration);
Log.event(`Completed runAfterProductionCompile in ${formattedDuration}`);
} catch (err) {
// Handle specific known errors differently if needed
if (isError(err)) {
Log.error(`Failed to run runAfterProductionCompile: ${err.message}`);
}
throw err;
} finally{
afterBuildSpinner == null ? void 0 : afterBuildSpinner.stop();
}
}
//# sourceMappingURL=after-production-compile.js.map