From 9445bea530f46ad1338196116ecadd7cd650a8ed Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Tue, 20 May 2014 14:23:41 -0400 Subject: [PATCH] FIX: add line numbers and file names to generated css --- lib/sass/discourse_sass_compiler.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/sass/discourse_sass_compiler.rb b/lib/sass/discourse_sass_compiler.rb index 1a1c4226a28..c8eb115c2d9 100644 --- a/lib/sass/discourse_sass_compiler.rb +++ b/lib/sass/discourse_sass_compiler.rb @@ -39,17 +39,23 @@ class DiscourseSassCompiler context = env.context_class.new(env, "#{@target}.scss", "app/assets/stylesheets/#{@target}.scss") + debug_opts = Rails.env.production? ? {} : { + line_numbers: true, + # debug_info: true, # great with Firebug + FireSass, but not helpful elsewhere + style: :expanded + } + ::Sass::Engine.new(@scss, { syntax: :scss, cache: false, read_cache: false, - style: Rails.env.production? ? :compressed : :expanded, + style: :compressed, filesystem_importer: opts[:safe] ? DiscourseSafeSassImporter : DiscourseSassImporter, sprockets: { context: context, environment: context.environment } - }).render + }.merge(debug_opts)).render end end