aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/tasks/yarn.rake
blob: 10703a1808145f7184b99782a3c7536b84b3b4f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

namespace :yarn do
  desc "Install all JavaScript dependencies as specified via Yarn"
  task :install do
    system("./bin/yarn install --no-progress --frozen-lockfile --production")
  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