Sha256: 517d4dc7ecf28fc3c0c952f55647152aad567c65a683aee73976a85987221b34

Contents?: true

Size: 674 Bytes

Versions: 2

Compression:

Stored size: 674 Bytes

Contents

class Condenser
  class SassMinifier
    
    def self.instance
      @instance ||= new
    end

    def self.call(environment, input)
      instance.call(environment, input)
    end
    
    def initialize(options = {})
      @options = options.merge({
        syntax: :scss,
        cache: false,
        read_cache: false,
        style: :compressed
      }).freeze
    end

    def call(environment, input)
      engine = Sass::Engine.new(input[:source], {filename: input[:filename]}.merge(@options))
      css, map = engine.render_with_sourcemap('')
      css = css.delete_suffix!("\n/*# sourceMappingURL= */\n")
      
      input[:source] = css
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
condenser-0.0.5 lib/condenser/minifiers/sass_minifier.rb
condenser-0.0.4 lib/condenser/minifiers/sass_minifier.rb