Closed
Description
Hello,
This is a idea for an alternative way to run the dartsass watcher without using foreman. I didn't start with a PR to add this because maybe it has some disadvantages I'm unaware of, or it might be unwanted.
So, instead of foreman, I changed my Rails config.ru file to spawn a thread that runs the dartsass watcher instead:
require_relative "config/environment"
if Rails.env.development?
dart_watcher_thread = Thread.new { system("./bin/rails dartsass:watch") }
at_exit { dart_watcher_thread.exit }
end
run Rails.application
Rails.application.load_server
For me, this offers a few advantages:
- No foreman dependency
- Terminal debugging (i.e. pry) still works
- Running ./bin/rails server is enough - this is minor, but probably removes some friction for people coming into dartsass and having to now change their usual start server command.
This feels like a better way, but of course I could be missing something. Thoughts?
Metadata
Metadata
Assignees
Labels
No labels