Sha256: e3b2859c8be06fc68600f767cff27d7f8a5601d5af1ad37ef1135b55d62f2b64

Contents?: true

Size: 637 Bytes

Versions: 71

Compression:

Stored size: 637 Bytes

Contents

# frozen_string_literal: true

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

71 entries across 71 versions & 1 rubygems

Version Path
nanoc-4.11.10 lib/nanoc/filters/uglify_js.rb
nanoc-4.11.9 lib/nanoc/filters/uglify_js.rb
nanoc-4.11.8 lib/nanoc/filters/uglify_js.rb
nanoc-4.11.7 lib/nanoc/filters/uglify_js.rb
nanoc-4.11.6 lib/nanoc/filters/uglify_js.rb
nanoc-4.11.5 lib/nanoc/filters/uglify_js.rb
nanoc-4.11.4 lib/nanoc/filters/uglify_js.rb
nanoc-4.11.3 lib/nanoc/filters/uglify_js.rb
nanoc-4.11.2 lib/nanoc/filters/uglify_js.rb
nanoc-4.11.1 lib/nanoc/filters/uglify_js.rb
nanoc-4.11.0 lib/nanoc/filters/uglify_js.rb
nanoc-4.10.4 lib/nanoc/filters/uglify_js.rb
nanoc-4.10.3 lib/nanoc/filters/uglify_js.rb
nanoc-4.10.2 lib/nanoc/filters/uglify_js.rb
nanoc-4.10.1 lib/nanoc/filters/uglify_js.rb
nanoc-4.10.0 lib/nanoc/filters/uglify_js.rb
nanoc-4.9.9 lib/nanoc/filters/uglify_js.rb
nanoc-4.9.8 lib/nanoc/filters/uglify_js.rb
nanoc-4.9.7 lib/nanoc/filters/uglify_js.rb
nanoc-4.9.6 lib/nanoc/filters/uglify_js.rb