mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 19:29:34 +08:00
FIX: add line numbers and file names to generated css
This commit is contained in:
@ -39,17 +39,23 @@ class DiscourseSassCompiler
|
|||||||
|
|
||||||
context = env.context_class.new(env, "#{@target}.scss", "app/assets/stylesheets/#{@target}.scss")
|
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, {
|
::Sass::Engine.new(@scss, {
|
||||||
syntax: :scss,
|
syntax: :scss,
|
||||||
cache: false,
|
cache: false,
|
||||||
read_cache: false,
|
read_cache: false,
|
||||||
style: Rails.env.production? ? :compressed : :expanded,
|
style: :compressed,
|
||||||
filesystem_importer: opts[:safe] ? DiscourseSafeSassImporter : DiscourseSassImporter,
|
filesystem_importer: opts[:safe] ? DiscourseSafeSassImporter : DiscourseSassImporter,
|
||||||
sprockets: {
|
sprockets: {
|
||||||
context: context,
|
context: context,
|
||||||
environment: context.environment
|
environment: context.environment
|
||||||
}
|
}
|
||||||
}).render
|
}.merge(debug_opts)).render
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user