Permalink
Browse files

Merge pull request #27728 from y-yagi/only_enhance_when_task_is_defined

only enhance when `assets:precompile` task is defined
  • Loading branch information...
eileencodes committed Jan 18, 2017
2 parents 783cbc1 + 617fc7e commit ac387e8e6d242204731ed9eff333ac491f15c55d
Showing with 3 additions and 1 deletion.
  1. +3 −1 railties/lib/rails/tasks/yarn.rake
@@ -6,4 +6,6 @@ namespace :yarn do
end
# Run Yarn prior to Sprockets assets precompilation, so dependencies are available for use.
-Rake::Task["assets:precompile"].enhance [ "yarn:install" ]
+if Rake::Task.task_defined?("assets:precompile")
+ Rake::Task["assets:precompile"].enhance [ "yarn:install" ]
+end

0 comments on commit ac387e8

Please sign in to comment.