do not re-compress files with .min. in the filename. closes #193
This commit is contained in:
parent
a344e00116
commit
0b7e7582d5
1 changed files with 20 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue