Sha256: a5c2a0b8bbe41b02a0e052a936d77f0c0b358f0c8ae6ead966d3a4373e851ca8

Contents?: true

Size: 595 Bytes

Versions: 9

Compression:

Stored size: 595 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

9 entries across 9 versions & 1 rubygems

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