This commit is contained in:
clover caruso 2025-08-02 20:28:35 -04:00
parent 5a07485601
commit 6e8ae507cf
2 changed files with 12 additions and 2 deletions

View file

@ -1,3 +1,8 @@
// This file contains the main site generator build process.
// By using `incr.work`'s ability to cache work between runs,
// the site generator is very fast to re-run.
//
// See `watch.ts` for a live development environment.
const { toRel, toAbs } = incr;
const globalCssPath = toAbs("src/global.css");

View file

@ -1,4 +1,9 @@
// Incremental compilation framework
// Incremental build system using singleton state.
// See `work()`, `compile()`, and `invalidate()` for details.
//
// All state is serializable to allow recovering state across sessions.
// This framework special-cases the asset map, but is otherwise
// agnostic of what it is a compiler for.
let running = false;
let jobs = 0;
let newKeys = 0;
@ -85,7 +90,7 @@ export function work<I, O>(job: Job<I, O>, input: I = null as I): Ref<O> {
}
export async function compile<T>(compiler: () => Promise<T>) {
ASSERT(!running, `Cannot run twice`);
ASSERT(!running, `Cannot run twice at the same time.`);
try {
running = true;
ASSERT(jobs === 0);