Pre hook for command Build Filesystem Image

I can’t seem to find how to do this (if it is possible), but I’d like to be able to automatically run a script before the filesystem bin is created via the Build Filesystem Image command.

Being able to automatically minify html/js/css files when building the image would save so much time and guarantee that I’m saving as much space as possible.