Skip to content

Commit

Permalink
fix: Use Tailwindcss::Ruby executable
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpolito committed Oct 21, 2024
1 parent e010015 commit 4873ab4
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/tasks/tailwind.rake
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,26 @@ require "tailwindcss-rails"
namespace :spina do
namespace :tailwind do
def spina_tailwind_compile_command
"#{Tailwindcss::Engine.root.join("exe/tailwindcss")} -i #{Spina::Engine.root.join("app/assets/stylesheets/spina/application.tailwind.css")} -o #{Rails.root.join("app/assets/builds", "spina/tailwind.css")} -c #{Rails.root.join("app/assets/config/spina/tailwind.config.js")}"
[
Tailwindcss::Ruby.executable,
"-i", Spina::Engine.root.join("app/assets/stylesheets/spina/application.tailwind.css").to_s,
"-o", Rails.root.join("app/assets/builds/spina/tailwind.css").to_s,
"-c", Rails.root.join("app/assets/config/spina/tailwind.config.js").to_s,
]
end

desc "Build your Tailwind CSS"
task build: :environment do
Rails::Generators.invoke("spina:tailwind_config", ["--force"])
system spina_tailwind_compile_command
command = spina_tailwind_compile_command
system *command
end

task watch: :environment do
Rails::Generators.invoke("spina:tailwind_config", ["--force"])
system "#{spina_tailwind_compile_command} -w"
command = spina_tailwind_compile_command
command << "-w"
system *command
end
end
end
Expand Down

0 comments on commit 4873ab4

Please sign in to comment.