How modern dev servers decide what to rebuild — a minimal engine

Some days ago at work, I was writing a small dynamic script to trigger a build for a single file. While doing that, I suddenly wondered…