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
webpacker-6.0.0.rc.5 lib/tasks/webpacker/clean.rake
webpacker-6.0.0.rc.4 lib/tasks/webpacker/clean.rake
webpacker-6.0.0.rc.3 lib/tasks/webpacker/clean.rake
webpacker-6.0.0.rc.2 lib/tasks/webpacker/clean.rake
webpacker-5.4.2 lib/tasks/webpacker/clean.rake
webpacker-5.4.1 lib/tasks/webpacker/clean.rake
webpacker-6.0.0.rc.1 lib/tasks/webpacker/clean.rake
webpacker-5.4.0 lib/tasks/webpacker/clean.rake
webpacker-5.3.0 lib/tasks/webpacker/clean.rake
webpacker-5.2.2 lib/tasks/webpacker/clean.rake
webpacker-6.0.0.beta.7 lib/tasks/webpacker/clean.rake
webpacker-6.0.0.beta.6 lib/tasks/webpacker/clean.rake
webpacker-6.0.0.beta.5 lib/tasks/webpacker/clean.rake
webpacker-6.0.0.beta.4 lib/tasks/webpacker/clean.rake
webpacker-6.0.0.beta.3 lib/tasks/webpacker/clean.rake
jetpacker-0.5.0 lib/tasks/webpacker/clean.rake
webpacker-6.0.0.beta.2 lib/tasks/webpacker/clean.rake
webpacker-6.0.0.beta.1 lib/tasks/webpacker/clean.rake
webpacker-6.0.0.beta lib/tasks/webpacker/clean.rake
webpacker-6.0.0.pre.2 lib/tasks/webpacker/clean.rake