Sha256: 79b8e8cc69cc3f1e02451e0afe2a93de17933b30e89cce747ab114bbe1cd0bfb

Contents?: true

Size: 581 Bytes

Versions: 2

Compression:

Stored size: 581 Bytes

Contents

# encoding: utf-8

module Nanoc::Filters
  class UglifyJS < Nanoc::Filter
    requires 'uglifier'

    # Runs the content through [UglifyJS](https://github.com/mishoo/UglifyJS2/).
    # This method optionally takes options to pass directly to Uglifier.
    #
    # @param [String] content The content to filter
    #
    # @option params [Array] :options ([]) A list of options to pass on to Uglifier
    #
    # @return [String] The filtered content
    def run(content, params = {})
      # Add filename to load path
      Uglifier.new(params).compile(content)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nanoc-3.8.0 lib/nanoc/filters/uglify_js.rb
nanoc-3.7.5 lib/nanoc/filters/uglify_js.rb