Add sourceMap comment to asset_hash and hash .map files by default

This commit is contained in:
Adam Heath 2016-02-26 08:46:00 +08:00
parent 0d983231d0
commit d883152e99
9 changed files with 64 additions and 2 deletions

View file

@ -0,0 +1,16 @@
class Middleware
def initialize(app)
@app = app
end
def call(env)
status, headers, response = @app.call(env)
body = ''
response.each {|part| body += part }
if (env["PATH_INFO"] =~ /css$/)
body += "\n/* Added by Rack filter */"
status, headers, response = Rack::Response.new(body, status, headers).finish
end
[status, headers, response]
end
end