Sha256: 4dbcc1858986dbb8b0d3bd9aaa25a99440b7c776c0be589fa16c371ae69dba20

Contents?: true

Size: 853 Bytes

Versions: 11

Compression:

Stored size: 853 Bytes

Contents

$stdout.sync = true

namespace :shakapacker do
  desc "Compile JavaScript packs using webpack for production with digests"
  task compile: ["shakapacker:verify_install", :environment] do
    Shakapacker.with_node_env(ENV.fetch("NODE_ENV", "production")) do
      Shakapacker.ensure_log_goes_to_stdout do
        exit! unless Shakapacker.compile
      end
    end
  end
end

def invoke_shakapacker_compile_in_assets_precompile_task
  Rake::Task["assets:precompile"].enhance do |task|
    prefix = task.name.split(/#|assets:precompile/).first

    Rake::Task["#{prefix}shakapacker:compile"].invoke
  end
end

if Shakapacker.config.shakapacker_precompile?
  if Rake::Task.task_defined?("assets:precompile")
    invoke_shakapacker_compile_in_assets_precompile_task
  else
    Rake::Task.define_task("assets:precompile" => ["shakapacker:compile"])
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
shakapacker-8.0.2 lib/tasks/shakapacker/compile.rake
shakapacker-8.0.1 lib/tasks/shakapacker/compile.rake
shakapacker-7.2.3 lib/tasks/shakapacker/compile.rake
shakapacker-7.3.0.beta.1 lib/tasks/shakapacker/compile.rake
shakapacker-7.2.2 lib/tasks/shakapacker/compile.rake
shakapacker-7.2.1 lib/tasks/shakapacker/compile.rake
shakapacker-7.2.0 lib/tasks/shakapacker/compile.rake
shakapacker-7.2.0.rc.0 lib/tasks/shakapacker/compile.rake
shakapacker-7.1.0 lib/tasks/shakapacker/compile.rake
shakapacker-7.0.3 lib/tasks/shakapacker/compile.rake
shakapacker-7.0.2 lib/tasks/shakapacker/compile.rake