Sha256: 7ceb4f1e1dc3546897d7af0a2c1731708eedd4d28e946242a09900ffd55f7183

Contents?: true

Size: 736 Bytes

Versions: 1

Compression:

Stored size: 736 Bytes

Contents

# frozen_string_literal: true

require 'tailwindcss/ruby'

module Cosensee
  # build TailwindCSS Command, based on https://github.com/rails/tailwindcss-rails
  module TailwindCommand
    def self.compile_command(output_dir: Cosensee::DEFAULT_OUTPUT_DIR, css_dir: DEFAULT_CSS_DIR, debug: false, **)
      command = [
        Tailwindcss::Ruby.executable(**),
        '-i', File.join(__dir__, '../../assets/styles/input.css'),
        '-o', File.join(output_dir, css_dir, 'tailwind.css'),
        '-c', Cosensee::TAILWIND_CONFIG_FILE
      ]

      command << '--minify' unless debug

      postcss_path = 'postcss.config.js'
      command += ['--postcss', postcss_path.to_s] if File.exist?(postcss_path)

      command
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cosensee-0.8.0 lib/cosensee/tailwind_command.rb