From 7390a9b8bc3461074e13b0a0b3ca0c342dc64e69 Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Tue, 9 Jan 2024 10:11:51 -0700 Subject: [PATCH] Use the official tailwindcss puma plugin (#4339) --- config/puma.rb | 4 ++-- lib/puma/plugin/tailwind.rb | 17 ----------------- 2 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 lib/puma/plugin/tailwind.rb diff --git a/config/puma.rb b/config/puma.rb index b24924d5053..8b913e34047 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -29,8 +29,8 @@ # Allow puma to be restarted by `bin/rails restart` command. plugin :tmp_restart - require_relative "../lib/puma/plugin/tailwind" - plugin :tailwind + # Run tailwindcss:watch in the background + plugin :tailwindcss end # Specifies the `port` that Puma will listen on to receive requests; default is 3000. diff --git a/lib/puma/plugin/tailwind.rb b/lib/puma/plugin/tailwind.rb deleted file mode 100644 index 3a923a51166..00000000000 --- a/lib/puma/plugin/tailwind.rb +++ /dev/null @@ -1,17 +0,0 @@ -require "puma/plugin" - -Puma::Plugin.create do - def start(launcher) - in_background do - warn "Starting TailwindCSS watcher..." - system( - File.expand_path("../../../bin/rails", __dir__), "--trace", "tailwindcss:watch", "RAILS_GROUPS=assets", - %i[out err] => File.expand_path("../../../log/tailwind.log", __dir__), - exception: true - ) - rescue StandardError => e - warn e.full_message(highlight: true) - launcher.restart - end - end -end