class Sprockets::ClosureCompressor


Sprockets::ClosureCompressor.new({ … })
environment.register_bundle_processor ‘application/javascript’,
Or to pass options to the Closure::Compiler class.
Sprockets::ClosureCompressor
environment.register_bundle_processor ‘application/javascript’,
To accept the default options
Public: Closure Compiler minifier.

def self.cache_key

def self.cache_key
  instance.cache_key
end

def self.call(input)

def self.call(input)
  instance.call(input)
end

def self.instance

Returns ClosureCompressor object.

Public: Return singleton instance with default options.
def self.instance
  @instance ||= new
end

def call(input)

def call(input)
  @compiler ||= Autoload::Closure::Compiler.new(@options)
  @compiler.compile(input[:data])
end

def initialize(options = {})

def initialize(options = {})
  @options = options
  @cache_key = "#{self.class.name}:#{Autoload::Closure::VERSION}:#{Autoload::Closure::COMPILER_VERSION}:#{VERSION}:#{DigestUtils.digest(options)}".freeze
end