namespace :yarn do
  desc "Install all JavaScript dependencies as specified via Yarn"
  task :install do
    system("./bin/yarn install")
  end
end

# Run Yarn prior to Sprockets assets precompilation, so dependencies are available for use.
if Rake::Task.task_defined?("assets:precompile")
  Rake::Task["assets:precompile"].enhance [ "yarn:install" ]
end

namespace :yarn do
  desc "Install all JavaScript dependencies as specified via Yarn"
  task :install do
    system('./bin/yarn install --no-progress')
  end
end

# Run Yarn prior to Sprockets assets precompilation, so dependencies are available for use.
if Rake::Task.task_defined?("assets:precompile")
  Rake::Task["assets:precompile"].enhance [ "yarn:install" ]
end

Make Yarn quieter during precompilation as that is typically run by a deploy tool like Capistrano and we dont need the play-by-play
Make Yarn quieter during precompilation as that is typically run by a deploy tool like Capistrano and we dont need the play-by-play
