   return if relativePath[relativePath.length - 1] is '/'
 
   resolvedPath = path.resolve(path.dirname(parentModule.filename), relativePath)
-  if resolvedPath.indexOf(cache.resourcePath) is 0
-    extension = path.extname(resolvedPath)
-    if extension
-      return resolvedPath if cache.extensions[extension]?.has(resolvedPath)
-    else
-      for extension, paths of cache.extensions
-        resolvedPathWithExtension = "#{resolvedPath}#{extension}"
-        return resolvedPathWithExtension if paths.has(resolvedPathWithExtension)
+  return unless isCorePath(resolvedPath)
+
+  extension = path.extname(resolvedPath)
+  if extension
+    return resolvedPath if cache.extensions[extension]?.has(resolvedPath)
+  else
+    for extension, paths of cache.extensions
+      resolvedPathWithExtension = "#{resolvedPath}#{extension}"
+      return resolvedPathWithExtension if paths.has(resolvedPathWithExtension)
 
   return
 

  ranges: {}
  registered: false
  resourcePath: null

# isAbsolute is inlined from fs-plus so that fs-plus itself can be required
# from this cache.

  isAbsolute = (pathToCheck) ->
    pathToCheck and pathToCheck[0] is '/'

isCorePath = (pathToCheck) ->
  pathToCheck.indexOf(cache.resourcePathWithTrailingSlash) is 0

loadDependencies = (modulePath, rootPath, rootMetadata, moduleCache) ->
  fs = require 'fs-plus'

