FIX: add line numbers and file names to generated css

This commit is contained in:
Neil Lalonde 2014-05-20 14:23:41 -04:00
parent f698ffd522
commit 9445bea530
1 changed files with 8 additions and 2 deletions

View File

@ -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