Sha256: c85898aad0a10ef769452761868f4545f54238c12c5c3207f7c58954fdf5cfcd

Contents?: true

Size: 689 Bytes

Versions: 49

Compression:

Stored size: 689 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 }, "#{Rails.root}/bin/yarn install --no-progress --frozen-lockfile")
  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

49 entries across 47 versions & 5 rubygems

Version Path
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/railties-6.0.0/lib/rails/tasks/yarn.rake
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/railties-6.0.0/lib/rails/tasks/yarn.rake
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/railties-6.0.0/lib/rails/tasks/yarn.rake
railties-6.0.0 lib/rails/tasks/yarn.rake
railties-6.0.0.rc2 lib/rails/tasks/yarn.rake
railties-6.0.0.rc1 lib/rails/tasks/yarn.rake
railties-6.0.0.beta3 lib/rails/tasks/yarn.rake
railties-6.0.0.beta2 lib/rails/tasks/yarn.rake
railties-6.0.0.beta1 lib/rails/tasks/yarn.rake