global
def start(launcher)
def start(launcher) @log_writer = launcher.log_writer @puma_pid = $$ @tailwind_pid = fork do Thread.new { monitor_puma } # Using IO.popen(command, 'r+') will avoid watch_command read from $stdin. # If we use system(*command) instead, IRB and Debug can't read from $stdin # correctly bacause some keystrokes will be taken by watch_command. begin IO.popen(Tailwindcss::Commands.watch_command, 'r+') do |io| IO.copy_stream(io, $stdout) end rescue Interrupt end end launcher.events.on_stopped { stop_tailwind } in_background do monitor_tailwind end end