diff --git a/lib/compiler.js b/lib/compiler.js index 7258e6a..614d76e 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -569,7 +569,7 @@ function resolveMiddlewarePath(rootDir, middleware, config) { // Try to require the module and check if . is a valid // function - var m = require(pathName); + var m = require(sourceFile); if (typeof m[fragment] === 'function') { resolved.sourceFile = sourceFile; return resolved;