use require.paths when resolving

This commit is contained in:
Chris Wanstrath
2011-09-08 01:47:16 -07:00
parent 22abf6497c
commit 6ec348068c

View File

@@ -72,7 +72,7 @@ resolve = (file) ->
file = file.replace '../', "#{prefix}/"
if file[0] isnt '/'
paths.some (path) ->
require.paths.some (path) ->
if /\.(.+)$/.test(file) and __exists "#{path}/#{file}"
file = "#{path}/#{file}"
else if expanded = __expand "#{path}/#{file}"