Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
precompile primary
Browse files Browse the repository at this point in the history
  • Loading branch information
yxmatic committed Apr 3, 2013
1 parent 745b9e5 commit 900af62
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/tasks/requirejs-rails_tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ EOM
end

namespace :precompile do
task :all => ["requirejs:precompile:prepare_source",
task :primary => ["requirejs:precompile:prepare_source",
"requirejs:precompile:generate_rjs_driver",
"requirejs:precompile:run_rjs",
"requirejs:precompile:digestify_and_compress"]
Expand All @@ -82,7 +82,7 @@ EOM
# We depend on test_node here so we'll fail early and hard if node
# isn't available.
task :external => ["requirejs:test_node"] do
ruby_rake_task "requirejs:precompile:all"
ruby_rake_task "requirejs:precompile:primary"
end

# copy all assets to tmp/assets
Expand Down Expand Up @@ -131,6 +131,7 @@ EOM
zgw.close
end
FileUtils.cp "#{built_asset_path}.gz", "#{digest_asset_path}.gz"
FileUtils.rm [built_asset_path, "#{built_asset_path}.gz"]

requirejs.config.manifest_path.open('wb') do |f|
YAML.dump(requirejs.manifest,f)
Expand All @@ -141,11 +142,11 @@ EOM

desc "Precompile RequireJS-managed assets"
task :precompile do
invoke_or_reboot_rake_task "requirejs:precompile:all"
invoke_or_reboot_rake_task "requirejs:precompile:primary"
end
end

task "assets:precompile" => ["requirejs:precompile:external"]
if ARGV[0] == "requirejs:precompile:all"
task "assets:precompile:primary" => ["requirejs:precompile:external"]
if ARGV[0] == "requirejs:precompile:primary"
task "assets:environment" => ["requirejs:precompile:disable_js_compressor"]
end

0 comments on commit 900af62

Please sign in to comment.