Search code examples
rubycoffeescriptuglifyjs

How to uglify coffeescript in a sinatra app?


Using coffeescript in sinatra. With the following code. it is able to return and compile coffeescript as js on the fly. Is there a good way to uglifying the result before coffee spits it out? Hope the question is clear

get "/coffee/*.js" do
    filename = params[:splat].first
    coffee "../public/coffee/#{filename}".to_sym
end

Solution

  • I guess sinatra-assetpack will do the trick.