gulachek / esmakefile

Make based build system in JavaScript
MIT License
0 stars 0 forks source link

Too much redundant work in build for watch #57

Open gulachek opened 1 month ago

gulachek commented 1 month ago

There should be some mechanism of caching computations like cycle detection for each watch-mode run. We don't need to recheck for a cycle.

Perhaps locking the Makefile should be factored out of Build.run(). It could be done by updateTarget, the watch mode runner, etc. This would guarantee that makefile rules are constant while watch is in place so that cache is valid. Maybe a WeakMap from makefile to certain computations would suffice.