sprockets ignores extensions after .js in build mode. closes #110

This commit is contained in:
Thomas Reynolds 2011-08-31 13:27:29 -07:00
parent cc577c0c73
commit d7f39350d5
2 changed files with 19 additions and 2 deletions

View file

@ -6,7 +6,19 @@ module Middleman::CoreExtensions::Sprockets
class << self
def registered(app)
app.set :js_compressor, false
# Cut off every extension after .js (which sprockets eats up)
app.build_reroute do |destination, request_path|
if !request_path.match(/\.js\./i)
false
else
[
destination.gsub(/\.js(\..*)$/, ".js"),
request_path.gsub(/\.js(\..*)$/, ".js")
]
end
end
app.after_configuration do
js_env = Middleman::CoreExtensions::Sprockets::JavascriptEnvironment.new(app)