Sha256: b32bf20fb6af8bb7d4a464d5f5e4c0b6feea4d1fb9c446b06364fcf0dbb7ae6e

Contents?: true

Size: 941 Bytes

Versions: 2

Compression:

Stored size: 941 Bytes

Contents

# frozen_string_literal: true

require "active_support"

if Rake::Task.task_defined?("assets:precompile")
  Rake::Task["assets:precompile"].enhance do
    Rake::Task["react_on_rails:assets:webpack"].invoke
  end
else
  Rake::Task.define_task("assets:precompile" => ["react_on_rails:assets:webpack"])
end

# Sprockets independent tasks
namespace :react_on_rails do
  namespace :assets do
    desc <<-DESC.strip_heredoc
      Compile assets with webpack
      Uses command defined with ReactOnRails.configuration.build_production_command

      sh "#{ReactOnRails::Utils.prepend_cd_node_modules_directory('<ReactOnRails.configuration.build_production_command>')}"
    DESC
    task webpack: :locale do
      if ReactOnRails.configuration.build_production_command.present?
        sh ReactOnRails::Utils.prepend_cd_node_modules_directory(
          ReactOnRails.configuration.build_production_command
        ).to_s
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
react_on_rails-12.0.0.pre.beta.1 lib/tasks/assets.rake
react_on_rails-12.0.0.pre.beta.0 lib/tasks/assets.rake