Sha256: 3a1df29389bd59d7fd63fe1cbc744e6c38e52ec155a6ad4ca63bd04488159669

Contents?: true

Size: 659 Bytes

Versions: 31

Compression:

Stored size: 659 Bytes

Contents

# frozen_string_literal: true

namespace :yarn do
  desc "Install all JavaScript dependencies as specified via Yarn"
  task :install do
    # Install only production deps when for not usual envs.
    valid_node_envs = %w[test development production]
    node_env = ENV.fetch("NODE_ENV") do
      valid_node_envs.include?(Rails.env) ? Rails.env : "production"
    end
    system({ "NODE_ENV" => node_env }, "./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

Version data entries

31 entries across 31 versions & 3 rubygems

Version Path
railties-5.2.8.1 lib/rails/tasks/yarn.rake
railties-5.2.8 lib/rails/tasks/yarn.rake
railties-5.2.7.1 lib/rails/tasks/yarn.rake
railties-5.2.7 lib/rails/tasks/yarn.rake
railties-5.2.6.3 lib/rails/tasks/yarn.rake
railties-5.2.6.2 lib/rails/tasks/yarn.rake
railties-5.2.6.1 lib/rails/tasks/yarn.rake
railties-5.2.6 lib/rails/tasks/yarn.rake
railties-5.2.4.6 lib/rails/tasks/yarn.rake
railties-5.2.5 lib/rails/tasks/yarn.rake
railties-5.2.4.5 lib/rails/tasks/yarn.rake
railties-5.2.4.4 lib/rails/tasks/yarn.rake
railties-5.2.4.3 lib/rails/tasks/yarn.rake
railties-5.2.4.2 lib/rails/tasks/yarn.rake
railties-5.2.4.1 lib/rails/tasks/yarn.rake
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/railties-5.2.3/lib/rails/tasks/yarn.rake
railties-5.2.4 lib/rails/tasks/yarn.rake
railties-5.2.4.rc1 lib/rails/tasks/yarn.rake
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/railties-5.2.3/lib/rails/tasks/yarn.rake
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/railties-5.2.3/lib/rails/tasks/yarn.rake