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

@@ -8,7 +8,7 @@ task :build do
dest = File.join(built_dir, contents_dir, "Resources")
%w(index.html src docs static extensions vendor ).each do |dir|
%w(index.html src docs static extensions vendor spec).each do |dir|
rm_rf File.join(dest, dir)
cp_r dir, File.join(dest, dir)
end
@@ -19,7 +19,7 @@ task :build do
"http://coffeescript.org/ - (try `npm i -g coffee-script`)"
end
sh "coffee -c #{dest}/src/stdlib/require.coffee"
sh "coffee -c #{dest}/src #{dest}/vendor #{dest}/extensions #{dest}/spec"
end
desc "Install the app in /Applications"

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