diff --git a/lib/hooks/moduleloader/index.js b/lib/hooks/moduleloader/index.js index 16696367c8..e1138d5f16 100644 --- a/lib/hooks/moduleloader/index.js +++ b/lib/hooks/moduleloader/index.js @@ -409,6 +409,9 @@ module.exports = function(sails) { hookName = identity.match(/^sails-hook-/) ? identity.replace(/^sails-hook-/,'') : identity; } + if (sails.config.hooks[hookName] === false) { + return memo; + } // Allow overriding core hooks if (sails.hooks[hookName]) { sails.log.verbose('Found hook: `'+hookName+'` in `node_modules/`. Overriding core hook w/ the same identity...');