Sha256: 4a83370b4dcf9a6600749156e58a9e287e11ab3c18d3dc490f24ca7b2948edd1

Contents?: true

Size: 606 Bytes

Versions: 20

Compression:

Stored size: 606 Bytes

Contents

module Nanoc::Filters
  # @api private
  class UglifyJS < Nanoc::Filter
    identifier :uglify_js

    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

20 entries across 20 versions & 1 rubygems

Version Path
nanoc-4.7.9 lib/nanoc/filters/uglify_js.rb
nanoc-4.7.8 lib/nanoc/filters/uglify_js.rb
nanoc-4.7.7 lib/nanoc/filters/uglify_js.rb
nanoc-4.7.6 lib/nanoc/filters/uglify_js.rb
nanoc-4.7.5 lib/nanoc/filters/uglify_js.rb
nanoc-4.7.4 lib/nanoc/filters/uglify_js.rb
nanoc-4.7.3 lib/nanoc/filters/uglify_js.rb
nanoc-4.7.2 lib/nanoc/filters/uglify_js.rb
nanoc-4.7.1 lib/nanoc/filters/uglify_js.rb
nanoc-4.7.0 lib/nanoc/filters/uglify_js.rb
nanoc-4.6.4 lib/nanoc/filters/uglify_js.rb
nanoc-4.6.3 lib/nanoc/filters/uglify_js.rb
nanoc-4.6.2 lib/nanoc/filters/uglify_js.rb
nanoc-4.6.1 lib/nanoc/filters/uglify_js.rb
nanoc-4.6.0 lib/nanoc/filters/uglify_js.rb
nanoc-4.5.4 lib/nanoc/filters/uglify_js.rb
nanoc-4.5.3 lib/nanoc/filters/uglify_js.rb
nanoc-4.5.2 lib/nanoc/filters/uglify_js.rb
nanoc-4.5.1 lib/nanoc/filters/uglify_js.rb
nanoc-4.5.0 lib/nanoc/filters/uglify_js.rb