CoffeeScript compiler is slow. Take steps to avoid it.

This commit is contained in:
Corey Johnson
2011-12-19 14:56:11 -08:00
parent 33f125a8e6
commit c679df770b
2 changed files with 8 additions and 3 deletions

View File

@@ -79,8 +79,13 @@ resolve = (file) ->
if file[0] isnt '/'
require.paths.some (path) ->
if /\.(.+)$/.test(file) and __exists "#{path}/#{file}"
fileExists = /\.(.+)$/.test(file) and __exists "#{path}/#{file}"
jsFileExists = not /\.(.+)$/.test(file) and __exists "#{path}/#{file}.js"
if fileExists
file = "#{path}/#{file}"
if jsFileExists
file = "#{path}/#{file}.js"
else if expanded = __expand "#{path}/#{file}"
file = expanded
else