Guest User

Untitled

a guest
Jan 24th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. # Config a Sprockets::Environment to mount as a Rack end-point. I like to use a subclass
  2. # as it allows the config to be easily reusable. Since I use the same instance for
  3. # all mount points I make it a singleton class. I just add this as an initializer to my
  4. # project since it is really just configuration.
  5.  
  6. class AssetServer < Sprockets::Environment
  7. include Singleton
  8.  
  9. def initialize
  10. super Rails.public_path
  11. append_path 'javascripts'
  12. append_path 'stylesheets'
  13. if Rails.env.production?
  14. self.js_compressor = YUI::JavaScriptCompressor.new :munge => true, :optimize => true
  15. self.css_compressor = YUI::CssCompressor.new
  16. end
  17. end
  18.  
  19. end
Add Comment
Please, Sign In to add comment