also watch CSS in unicorn on dev
This commit is contained in:
parent
7c0e6b820e
commit
800760e353
|
@ -52,7 +52,7 @@ Discourse::Application.configure do
|
||||||
config.developer_emails = emails.split(",").map(&:downcase).map(&:strip)
|
config.developer_emails = emails.split(",").map(&:downcase).map(&:strip)
|
||||||
end
|
end
|
||||||
|
|
||||||
if defined?(Rails::Server) || defined?(Puma)
|
if defined?(Rails::Server) || defined?(Puma) || defined?(Unicorn)
|
||||||
require 'stylesheet/watcher'
|
require 'stylesheet/watcher'
|
||||||
STDERR.puts "Starting CSS change watcher"
|
STDERR.puts "Starting CSS change watcher"
|
||||||
@watcher = Stylesheet::Watcher.watch
|
@watcher = Stylesheet::Watcher.watch
|
||||||
|
|
|
@ -68,9 +68,12 @@ module Stylesheet
|
||||||
Stylesheet::Manager.cache.clear
|
Stylesheet::Manager.cache.clear
|
||||||
|
|
||||||
message = ["desktop", "mobile", "admin"].map do |name|
|
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
|
end
|
||||||
|
|
||||||
MessageBus.publish '/file-change', message
|
MessageBus.publish '/file-change', message
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue