mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 19:03:48 +08:00
added DONT_PRECOMPILE_CSS env var
This commit is contained in:
parent
42b72a9834
commit
25db4cc4d9
|
@ -75,21 +75,25 @@ task 'assets:precompile:before' do
|
|||
end
|
||||
|
||||
task 'assets:precompile:css' => 'environment' do
|
||||
STDERR.puts "Start compiling CSS: #{Time.zone.now}"
|
||||
if ENV["DONT_PRECOMPILE_CSS"] == "1"
|
||||
STDERR.puts "Skipping CSS precompilation, ensure CSS lives in a shared directory across hosts"
|
||||
else
|
||||
STDERR.puts "Start compiling CSS: #{Time.zone.now}"
|
||||
|
||||
RailsMultisite::ConnectionManagement.each_connection do |db|
|
||||
# Heroku precompiles assets before db migration, so tables may not exist.
|
||||
# css will get precompiled during first request instead in that case.
|
||||
RailsMultisite::ConnectionManagement.each_connection do |db|
|
||||
# Heroku precompiles assets before db migration, so tables may not exist.
|
||||
# css will get precompiled during first request instead in that case.
|
||||
|
||||
if ActiveRecord::Base.connection.table_exists?(ColorScheme.table_name)
|
||||
STDERR.puts "Compiling css for #{db}"
|
||||
[:desktop, :mobile, :desktop_rtl, :mobile_rtl].each do |target|
|
||||
STDERR.puts "target: #{target} #{DiscourseStylesheets.compile(target)}"
|
||||
if ActiveRecord::Base.connection.table_exists?(ColorScheme.table_name)
|
||||
STDERR.puts "Compiling css for #{db}"
|
||||
[:desktop, :mobile, :desktop_rtl, :mobile_rtl].each do |target|
|
||||
STDERR.puts "target: #{target} #{DiscourseStylesheets.compile(target)}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
STDERR.puts "Done compiling CSS: #{Time.zone.now}"
|
||||
STDERR.puts "Done compiling CSS: #{Time.zone.now}"
|
||||
end
|
||||
end
|
||||
|
||||
def assets_path
|
||||
|
|
Loading…
Reference in New Issue
Block a user