Support creation of depfiles for use with make and ninja based builds
When compiling sass files with make or ninja based buildsystems, it would be nice if dart-sass would be invoked only if a scss file (or one if its dependencies) has changed.
This can be achieved by so called "depfiles". These files are written by the compiler (dart-sass in this case) during compilation and contain the dependencies of a source file.
I'm aware that dart-sass has the '--update' option, but it still takes some time to parse all the imports. If depfiles would be written by dart-sass, the buildsystem wouldn't even need to call dart-sass at the first place (if nothing has changed).
I'm willing to contribute this to dart-sass, but only if such a feature would be accepted at all.
Is there some sort of specification for depfiles that could allow them to (in principle) be used by a variety of build systems? If this is too specific to make/ninja, we're unlikely to accept it, but if it has utility beyond any one build system, it is something that we could merge if you were to implement it.
The format of the depfile is not formally specified, but there seems to be an agreed on format. It is a subset of the syntax of a Makefile. This is also the format that gcc generates when '-MD' is passed.
I did a quick google search and found the following buildsystems to support depfiles: make, ninja, meson (to some extend)