It's possible to have Visual Studio generate a file on save of another file using a Single File Generator. T4 templates use the built-in TextTemplatingFileGenerator, but I believe other custom generators can be installed by a Visual Studio Extension.
It'd be great to have this functionality with Mustache templates as well.
Getting it working on .NET Standard