Sha256: e56746f5953229dc34cfad77050b3d80946390b97d4500879facb5da12b0af01

Contents?: true

Size: 647 Bytes

Versions: 24

Compression:

Stored size: 647 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|
    Webpacker::Configuration.installing = true

    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

24 entries across 24 versions & 1 rubygems

Version Path
shakapacker-6.6.0 lib/tasks/webpacker/install.rake
shakapacker-6.5.6 lib/tasks/webpacker/install.rake
shakapacker-6.5.5 lib/tasks/webpacker/install.rake
shakapacker-6.5.4 lib/tasks/webpacker/install.rake
shakapacker-6.5.3 lib/tasks/webpacker/install.rake
shakapacker-6.5.2 lib/tasks/webpacker/install.rake
shakapacker-6.5.1 lib/tasks/webpacker/install.rake
shakapacker-6.5.0 lib/tasks/webpacker/install.rake
shakapacker-6.4.1 lib/tasks/webpacker/install.rake
shakapacker-6.4.0 lib/tasks/webpacker/install.rake
shakapacker-6.3.0 lib/tasks/webpacker/install.rake
shakapacker-6.3.0.pre.rc.1 lib/tasks/webpacker/install.rake
shakapacker-6.2.1 lib/tasks/webpacker/install.rake
shakapacker-6.2.0 lib/tasks/webpacker/install.rake
shakapacker-6.1.1 lib/tasks/webpacker/install.rake
shakapacker-6.1.0 lib/tasks/webpacker/install.rake
shakapacker-6.1.0.beta.0 lib/tasks/webpacker/install.rake
shakapacker-6.0.2 lib/tasks/webpacker/install.rake
shakapacker-6.0.1 lib/tasks/webpacker/install.rake
shakapacker-6.0.0 lib/tasks/webpacker/install.rake