Module: Middleman::Extensions::MinifyJavascript
- Defined in:
- lib/middleman-more/extensions/minify_javascript.rb
Overview
Minify Javascript Extension
Defined Under Namespace
Classes: Rack
Class Method Summary collapse
-
.registered(app, options = {}) ⇒ Object
(also: included)
Once registered.
Class Method Details
.registered(app, options = {}) ⇒ Object Also known as: included
Once registered
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/middleman-more/extensions/minify_javascript.rb', line 12 def registered(app, ={}) app.set :js_compressor, false ignore = Array([:ignore]) << /\.min\./ inline = [:inline] || false # Once config is parsed app.after_configuration do chosen_compressor = js_compressor || [:compressor] || begin require 'uglifier' ::Uglifier.new end # Setup Rack middlware to minify JS use Rack, :compressor => chosen_compressor, :ignore => ignore, :inline => inline end end |