Inline svg with html outer adding custom class

You can completely avoid using gulp. Refer to this section in the documentation:

The problem with your approach is that you’re only looking for the classes in the layouts/ and content/. The proper way is to look at the files generated by Hugo, and then do the purging. That is what the above link covers.