Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Require 'cssmin' and 'uglifier' only when compiling. This allows the …

…deploy environment to not require a JavaScript execution enviornment.
  • Loading branch information...
commit d6bd9daa84f04c05bd19356d2dffc46db11c0b43 1 parent 359858c
@gkellogg gkellogg authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/sinatra/simple_assets.rb
View
4 lib/sinatra/simple_assets.rb
@@ -1,6 +1,4 @@
require 'sinatra/base'
-require 'cssmin'
-require 'uglifier'
module Sinatra
module SimpleAssets
@@ -47,8 +45,10 @@ def hash
def content
case @type
when :js
+ require 'uglifier'
@content ||= Uglifier.new.compress combined
when :css
+ require 'cssmin'
@content ||= CSSMin.minify combined
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.