Sha256: e435d6bdcef4c4faa1c99074eb0f47ee127b686cc00e72728ae689fda04ee27b

Contents?: true

Size: 1.64 KB

Versions: 2

Compression:

Stored size: 1.64 KB

Contents

# frozen_string_literal: true

namespace :solidus_admin do
  namespace :tailwindcss do
    require "solidus_admin/tailwindcss"

    desc "Build Solidus Admin's Tailwind's css"
    task build: :environment do
      SolidusAdmin::Tailwindcss.run
    end

    desc <<~DESC
      Watch and build Solidus Admin's Tailwind css on file changes

      It needs to be re-run whenever:

      - `SolidusAdmin::Config.tailwind_content` is updated
      - `SolidusAdmin::Config.tailwind_stylesheets` is updated
      - `bin/rails solidus_admin:tailwindcss:override_config` is run
      - `bin/rails solidus_admin:tailwindcss:override_stylesheet` is run
      - The override files are updated
    DESC
    task watch: :environment do
      SolidusAdmin::Tailwindcss.run("-w")
    end

    desc <<~DESC
      Override Solidus Admin's Tailwindcss configuration

      It copies the config file from the engine to the app, so it can be customized.
    DESC
    task override_config: :environment do
      SolidusAdmin::Tailwindcss.copy_file(
        SolidusAdmin::Tailwindcss.config_engine_path,
        SolidusAdmin::Tailwindcss.config_app_path
      )
    end

    desc <<~DESC
      Override Solidus Admin's Tailwind's stylesheet

      It copies the stylesheet file from the engine to the app, so it can be customized.
    DESC
    task override_stylesheet: :environment do
      SolidusAdmin::Tailwindcss.copy_file(
        SolidusAdmin::Tailwindcss.stylesheet_engine_path,
        SolidusAdmin::Tailwindcss.stylesheet_app_path
      )
    end
  end
end

if Rake::Task.task_defined?("assets:precompile")
  Rake::Task["assets:precompile"].enhance(["solidus_admin:tailwindcss:build"])
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
solidus_admin-0.0.2 lib/tasks/tailwindcss.rake
solidus_admin-0.0.1 lib/tasks/tailwindcss.rake