Skip to content

Instantly share code, notes, and snippets.

@msimerson
Created July 7, 2015 01:11
Show Gist options
  • Save msimerson/80fe184e12ef5ad08f4e to your computer and use it in GitHub Desktop.
Save msimerson/80fe184e12ef5ad08f4e to your computer and use it in GitHub Desktop.
diff --git a/plugins.js b/plugins.js
index 4ef6345..8af4158 100644
--- a/plugins.js
+++ b/plugins.js
@@ -193,9 +193,8 @@ plugins._load_and_compile_plugin = function (name) {
throw 'Loading plugin ' + name + ' failed: ' + last_err;
}
var custom_require = function _haraka_require (module) {
- if (!/^\./.test(module)) {
- return require(module);
- }
+ if (!/^\./.test(module)) return require(module);
+ if (/package\.json$/.test(fp[i])) return require(module);
if (utils.existsSync(__dirname + '/' + module + '.js') ||
utils.existsSync(__dirname + '/' + module)) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment