Rewatch: detect changes to config and compiler version
In case the rescript.json or the compiler version changes, rewatch should automatically clean before doing a build.
(Also, if the project was compiled with bsb before, do a clean before the build.)
Like bsb does currently:
Different compiler version: clean current repo
Cleaning... 5 files.
Cleaning... 241 files.
Cleaning... 75 files.
Cleaning... 80 files.
...
@cknitt any idea what exactly bsb is checking to figure this out?
This happens here in bsb:
https://github.com/rescript-lang/rescript/blob/c092acd0ff979d1a4b2bbf67f7986dbad8940b6d/compiler/bsb/bsb_ninja_regen.ml#L38-L55
We no longer have this file, so I think we need to cook up some new file to store the version. @jfrolich does anything come to mind, or should we introduce something new?