Sha256: 1d6622767538e40caf3f84ffcbb89e1268c5add693448bcdaa97bbfc6725dc10

Contents?: true

Size: 583 Bytes

Versions: 9

Compression:

Stored size: 583 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

9 entries across 9 versions & 1 rubygems

Version Path
nanoc-3.7.4 lib/nanoc/filters/uglify_js.rb
nanoc-3.7.3 lib/nanoc/filters/uglify_js.rb
nanoc-3.7.2 lib/nanoc/filters/uglify_js.rb
nanoc-3.7.1 lib/nanoc/filters/uglify_js.rb
nanoc-3.7.0 lib/nanoc/filters/uglify_js.rb
nanoc-3.6.11 lib/nanoc/filters/uglify_js.rb
nanoc-3.6.10 lib/nanoc/filters/uglify_js.rb
nanoc-3.6.9 lib/nanoc/filters/uglify_js.rb
nanoc-3.6.8 lib/nanoc/filters/uglify_js.rb