Commit 6b68f2c0 by Calen Pennington

Use coffee watch command to watch whole directories, so that it will pick up new…

Use coffee watch command to watch whole directories, so that it will pick up new coffee files as they are created
parent 1b4eece2
......@@ -27,10 +27,11 @@ def coffee_cmd(watch=false, debug=false)
#
# Ref: https://github.com/joyent/node/issues/2479
#
# Instead, watch 50 files per process in parallel
# Rather than watching all of the directories in one command
# watch each static files subdirectory separately
cmds = []
Dir['*/static/**/*.coffee'].each_slice(50) do |coffee_files|
cmds << "node_modules/.bin/coffee --watch --compile #{coffee_files.join(' ')}"
['lms/static/coffee', 'cms/static/coffee', 'common/static/coffee', 'common/static/xmodule'].each do |coffee_folder|
cmds << "node_modules/.bin/coffee --watch --compile #{coffee_folder}"
end
cmds
else
......@@ -119,12 +120,15 @@ namespace :assets do
namespace :sass do
# In watch mode, sass doesn't immediately compile out of date files,
# so force a recompile first
task :_watch => 'assets:sass:debug'
# Also force xmodule files to be generated before we start watching anything
task :_watch => ['assets:sass:debug', 'assets:xmodule']
multitask :debug => 'assets:xmodule:debug'
end
multitask :coffee => 'assets:xmodule'
namespace :coffee do
# Force xmodule files to be generated before we start watching anything
task :_watch => 'assets:xmodule'
multitask :debug => 'assets:xmodule:debug'
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment