zambezi / ez-build

Zambezi build tool
MIT License
2 stars 1 forks source link

Tool-independent incremental compilation #12

Open mstade opened 8 years ago

mstade commented 8 years ago

Because of the way ez-build assumes you have two target environments (i.e. dev which is implicit and prod which is defined with --production) we can also implement tooling independent incremental compilation. This is a side effect of how in dev we assume all output files are unlinked, and that there's a 1:1 mapping between source file and destination file. This should also hold true for 1:n mappings (e.g. css modules, which implies you have a destination css file, and also a json mapping of selectors, so 1:2) since we only have to keep track of the source files. However, for n:1 mappings it becomes more difficult, since if only one of the inputs (n) change it might only affect part of the output. This requires intimate knowledge of what the output is, and so quickly becomes tool dependent.

Why do we want this to be tool independent? A couple of reasons:

How do we do this? By realizing the following truths: