Add preBuild hook for addons (Resolves #2410)