Sha256: 8a0bf687835b08b5745e71b9aaced20eb11136650dacbd9e595592dfe7f75498

Contents?: true

Size: 710 Bytes

Versions: 47

Compression:

Stored size: 710 Bytes

Contents

$stdout.sync = true

require "webpacker/configuration"

namespace :webpacker do
  desc "Remove old compiled webpacks"
  task :clean, [:keep, :age] => ["webpacker:verify_install", :environment] do |_, args|
    Webpacker.ensure_log_goes_to_stdout do
      Webpacker.clean(Integer(args.keep || 2), Integer(args.age || 3600))
    end
  end
end

skip_webpacker_clean = %w(no false n f).include?(ENV["WEBPACKER_PRECOMPILE"])

unless skip_webpacker_clean
  # Run clean if the assets:clean is run
  if Rake::Task.task_defined?("assets:clean")
    Rake::Task["assets:clean"].enhance do
      Rake::Task["webpacker:clean"].invoke
    end
  else
    Rake::Task.define_task("assets:clean" => "webpacker:clean")
  end
end

Version data entries

47 entries across 47 versions & 4 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/webpacker-5.4.4/lib/tasks/webpacker/clean.rake
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/webpacker-5.4.4/lib/tasks/webpacker/clean.rake
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/webpacker-5.4.4/lib/tasks/webpacker/clean.rake
jetpacker-0.7.0 lib/tasks/webpacker/clean.rake
webpacker-5.4.4 lib/tasks/webpacker/clean.rake
jetpacker-0.6.0 lib/tasks/webpacker/clean.rake
shakapacker-6.2.1 lib/tasks/webpacker/clean.rake
shakapacker-6.2.0 lib/tasks/webpacker/clean.rake
shakapacker-6.1.1 lib/tasks/webpacker/clean.rake
shakapacker-6.1.0 lib/tasks/webpacker/clean.rake
shakapacker-6.1.0.beta.0 lib/tasks/webpacker/clean.rake
shakapacker-6.0.2 lib/tasks/webpacker/clean.rake
shakapacker-6.0.1 lib/tasks/webpacker/clean.rake
shakapacker-6.0.0 lib/tasks/webpacker/clean.rake
shakapacker-6.0.0.rc.14 lib/tasks/webpacker/clean.rake
shakapacker-6.0.0.rc.13 lib/tasks/webpacker/clean.rake
shakapacker-6.0.0.rc.12 lib/tasks/webpacker/clean.rake
shakapacker-6.0.0.rc.6 lib/tasks/webpacker/clean.rake
webpacker-6.0.0.rc.6 lib/tasks/webpacker/clean.rake
webpacker-5.4.3 lib/tasks/webpacker/clean.rake