Webpack (v1-5) plugin that gives ability to add callback before build (or after, or at any other event hook). Can stop compilation by condition. Read more