also watch CSS in unicorn on dev

This commit is contained in:
Sam 2018-03-09 17:47:57 +11:00
parent 7c0e6b820e
commit 800760e353
2 changed files with 6 additions and 3 deletions

View File

@ -52,7 +52,7 @@ Discourse::Application.configure do
config.developer_emails = emails.split(",").map(&:downcase).map(&:strip)
end
if defined?(Rails::Server) || defined?(Puma)
if defined?(Rails::Server) || defined?(Puma) || defined?(Unicorn)
require 'stylesheet/watcher'
STDERR.puts "Starting CSS change watcher"
@watcher = Stylesheet::Watcher.watch

View File

@ -68,9 +68,12 @@ module Stylesheet
Stylesheet::Manager.cache.clear
message = ["desktop", "mobile", "admin"].map do |name|
{ target: name, new_href: Stylesheet::Manager.stylesheet_href(name.to_sym) , theme_key: SiteSetting.default_theme_key }
{
target: name,
new_href: Stylesheet::Manager.stylesheet_href(name.to_sym),
theme_key: SiteSetting.default_theme_key
}
end
MessageBus.publish '/file-change', message
end