Added compile hook

Adds a compile hook to the plugin