Class: Middleman::Extensions::MinifyJavascript

Inherits:
Middleman::Extension show all
Defined in:
lib/middleman-core/extensions/minify_javascript.rb

Overview

Minify Javascript Extension

Defined Under Namespace

Classes: Rack

Constant Summary

Constants included from Contracts

Contracts::PATH_MATCHER

Instance Attribute Summary

Attributes inherited from Middleman::Extension

#app, #options

Instance Method Summary collapse

Methods inherited from Middleman::Extension

activated_extension, #add_exposed_to_context, #after_build, #after_configuration, #after_extension_activated, after_extension_activated, #before_build, #before_configuration, clear_after_extension_callbacks, config, define_setting, expose_to_application, expose_to_config, expose_to_template, global_config, helpers, #initialize, #manipulate_resource_list, option, resources

Methods included from Contracts

#Contract

Constructor Details

This class inherits a constructor from Middleman::Extension

Instance Method Details

#readyObject



16
17
18
19
20
21
22
23
# File 'lib/middleman-core/extensions/minify_javascript.rb', line 16

def ready
  # Setup Rack middleware to minify JS
  app.use Rack, compressor: options[:compressor],
                ignore: Array(options[:ignore]) + [/\.min\./],
                inline: options[:inline],
                content_types: options[:content_types],
                inline_content_types: options[:inline_content_types]
end