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