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

Commit

Permalink
Change the Rake task dependencies to be less brittle
Browse files Browse the repository at this point in the history
  • Loading branch information
carsomyr committed Jul 22, 2015
1 parent 8e1a9d1 commit bd84c42
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/tasks/requirejs-rails_tasks.rake
Expand Up @@ -72,17 +72,14 @@ OS X Homebrew users can use 'brew install node'.
end

namespace :precompile do
task all: ["requirejs:precompile:prepare_source",
"requirejs:precompile:generate_rjs_driver",
"requirejs:precompile:run_rjs",
"requirejs:precompile:digestify_and_compress"]
task all: ["requirejs:precompile:digestify_and_compress"]

# Invoke another ruby process if we're called from inside
# assets:precompile so we don't clobber the environment
#
# We depend on test_node here so we'll fail early and hard if node
# isn't available.
task external: ["requirejs:test_node"] do
task :external do
ruby_rake_task "requirejs:precompile:all"
end

Expand Down Expand Up @@ -132,7 +129,9 @@ OS X Homebrew users can use 'brew install node'.
end

task run_rjs: ["requirejs:setup",
"requirejs:test_node"] do
"requirejs:test_node",
"requirejs:precompile:prepare_source",
"requirejs:precompile:generate_rjs_driver"] do
requirejs.config.build_dir.mkpath
requirejs.config.target_dir.mkpath
requirejs.config.driver_path.dirname.mkpath
Expand All @@ -145,7 +144,7 @@ OS X Homebrew users can use 'brew install node'.

# Copy each built asset, identified by a named module in the
# build config, to its Sprockets digestified name.
task digestify_and_compress: ["requirejs:setup"] do
task digestify_and_compress: ["requirejs:precompile:run_rjs"] do
requirejs.config.build_config["modules"].each do |m|
module_name = requirejs.config.module_name_for(m)
paths = requirejs.config.build_config["paths"] || {}
Expand Down

0 comments on commit bd84c42

Please sign in to comment.