mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 11:15:05 +08:00
DEV: Improve CSS watcher perf (#21784)
Target only stylesheet directories. Should help with listen/fsevent choking.
This commit is contained in:
parent
5bf2dca24a
commit
ac0f5ca1b2
|
@ -21,7 +21,9 @@ module Stylesheet
|
|||
@default_paths = ["app/assets/stylesheets"]
|
||||
Discourse.plugins.each do |plugin|
|
||||
if plugin.path.to_s.include?(Rails.root.to_s)
|
||||
@default_paths << File.dirname(plugin.path).sub(Rails.root.to_s, "").sub(%r{\A/}, "")
|
||||
path = File.dirname(plugin.path).sub(Rails.root.to_s, "").sub(%r{\A/}, "")
|
||||
path << "/assets/stylesheets"
|
||||
@default_paths << path if File.exist?(path)
|
||||
else
|
||||
# if plugin doesn’t seem to be in our app, consider it as outside of the app
|
||||
# and ignore it
|
||||
|
@ -41,7 +43,7 @@ module Stylesheet
|
|||
end
|
||||
end
|
||||
|
||||
listener_opts = { ignore: /xxxx/, only: /\.(css|scss)\z/ }
|
||||
listener_opts = { ignore: [/node_modules/], only: /\.s?css\z/ }
|
||||
listener_opts[:force_polling] = true if ENV["FORCE_POLLING"]
|
||||
|
||||
Thread.new do
|
||||
|
|
Loading…
Reference in New Issue
Block a user