Closed pablox-cl closed 9 years ago
Ok, I'll take a look - it might take me awhile to debug. If you figure it out, please submit a pull request
I tried to narrow this, and it seems that is because in BundledAsset#initialize
, the context.evaluate
line:
@source = context.evaluate(pathname, :data => @source, :processors => environment.bundle_processors(content_type))
...calls
Sprockets::SassCompressor#evaluate
instead of
Sprockets::Sass::SassTemplate#evaluate
This leads to:
sprockets-2.12.2/lib/sprockets/sass_compressor.rb @ line 19 Sprockets::SassCompressor#evaluate:
18: def evaluate(context, locals, &block)
=> 19: binding.pry
20: ::Sass::Engine.new(data, {
21: :syntax => :scss,
22: :cache => false,
23: :read_cache => false,
24: :style => :compressed
25: }).render
26: end
And therefore Sprockets::Sass.options
are discarded.
PS.- By mistake I deleted the previous comment =/
Are you setting the css_compressor
option? If so, that could certainly be overriding the output. If not, I don't see why the Sass::Compressor would be evaluated. Which version of Sprockets are you using?
oh my lol. You are right... I had it set it up in a nasty place, and I totally forgot about it. Sorry for the noise :/. When debugging, I never stumbled into any check for css_compressor
, how did you find it out?
Just remembered that's generally how the Sass::Compressor is configured
I'm using sprockets-sass outside rails/sinatra... (actually on nanoc). And while sprockets-sass it's actually working, I can't make the sass options to pass, and in the end I always get a compressed css.
I tried to debug where the problem is, and I found that
it indeed renders correctly (output style, line_comments, ecc), but somewhere along the way, it gets everything squashed. Looks like sprockets it's doing it thing regardless where these options are set.
The "BundledAsset" I got from the
find_asset
sprockets method, returns the squashed file. Maybe the problem has to do with that?