do not re-compress files with .min. in the filename. closes #193

This commit is contained in:
Thomas Reynolds 2011-12-27 19:46:50 -08:00
parent a344e00116
commit 0b7e7582d5

View file

@ -94,7 +94,16 @@ module Middleman::CoreExtensions::Sprockets
def initialize(app) def initialize(app)
super super
self.js_compressor = app.js_compressor expire_index!
unregister_bundle_processor 'application/javascript', :js_compressor
register_bundle_processor 'application/javascript', :js_compressor do |context, data|
if context.pathname.to_s =~ /\.min\./
data
else
app.js_compressor.compress(data)
end
end if app.js_compressor
# configure search paths # configure search paths
append_path app.js_dir append_path app.js_dir
@ -110,7 +119,16 @@ module Middleman::CoreExtensions::Sprockets
def initialize(app) def initialize(app)
super super
self.css_compressor = app.css_compressor expire_index!
unregister_bundle_processor 'text/css', :css_compressor
register_bundle_processor 'text/css', :css_compressor do |context, data|
if context.pathname.to_s =~ /\.min\./
data
else
app.css_compressor.compress(data)
end
end if app.css_compressor
# configure search paths # configure search paths
append_path app.css_dir append_path app.css_dir