class Sprockets::UglifierCompressor - sprockets-2.11.3 Documentation

# class Sprockets::UglifierCompressor

### Public Class Methods

engine_initialized?() click to toggle source

    # File lib/sprockets/uglifier_compressor.rb, line 7
    def self.engine_initialized?
      defined?(::Uglifier)
    end

### Public Instance Methods

evaluate(context, locals, &block) click to toggle source

    # File lib/sprockets/uglifier_compressor.rb, line 18
    def evaluate(context, locals, &block)
      # Feature detect Uglifier 2.0 option support
      if Uglifier::DEFAULTS[:copyright]
        # Uglifier < 2.x
        Uglifier.new(:copyright => false).compile(data)
      else
        # Uglifier >= 2.x
        Uglifier.new(:comments => :none).compile(data)
      end
    end

initialize_engine() click to toggle source

    # File lib/sprockets/uglifier_compressor.rb, line 11
    def initialize_engine
      require_template_library 'uglifier'
    end

prepare() click to toggle source

    # File lib/sprockets/uglifier_compressor.rb, line 15
    def prepare
    end