Sha256: 140052ddb295009fce34791e826907e5112436e2bb60001f0698b2b28f86bf32

Contents?: true

Size: 599 Bytes

Versions: 7

Compression:

Stored size: 599 Bytes

Contents

install_template_path = File.expand_path("../../install/template.rb", __dir__).freeze
bin_path = ENV["BUNDLE_BIN"] || Rails.root.join("bin")

namespace :webpacker do
  desc "Install Webpacker in this application"
  task install: [:check_node, :check_yarn] do |task|
    prefix = task.name.split(/#|webpacker:install/).first

    if Rails::VERSION::MAJOR >= 5
      exec "#{RbConfig.ruby} #{bin_path}/rails #{prefix}app:template LOCATION='#{install_template_path}'"
    else
      exec "#{RbConfig.ruby} #{bin_path}/rake #{prefix}rails:template LOCATION='#{install_template_path}'"
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
webpacker-6.0.0.rc.6 lib/tasks/webpacker/install.rake
webpacker-6.0.0.rc.5 lib/tasks/webpacker/install.rake
webpacker-6.0.0.rc.4 lib/tasks/webpacker/install.rake
webpacker-6.0.0.rc.3 lib/tasks/webpacker/install.rake
webpacker-6.0.0.rc.2 lib/tasks/webpacker/install.rake
webpacker-6.0.0.rc.1 lib/tasks/webpacker/install.rake
webpacker-6.0.0.beta.7 lib/tasks/webpacker/install.rake