Require assets in all environments by default and provide a way to opt-out from uglifier.

This commit is contained in:
José Valim
2011-07-11 11:19:03 -03:00
parent d5e8722683
commit 3da3df8fcb
2 changed files with 8 additions and 3 deletions

View File

@@ -70,8 +70,13 @@ module Sprockets
if assets.compress
# temporarily hardcode default JS compressor to uglify. Soon, it will work
# the same as SCSS, where a default plugin sets the default.
env.js_compressor = LazyCompressor.new { expand_js_compressor(assets.js_compressor || :uglifier) }
env.css_compressor = LazyCompressor.new { expand_css_compressor(assets.css_compressor) }
unless assets.js_compressor == false
env.js_compressor = LazyCompressor.new { expand_js_compressor(assets.js_compressor || :uglifier) }
end
unless assets.css_compressor == false
env.css_compressor = LazyCompressor.new { expand_css_compressor(assets.css_compressor) }
end
end
env

View File

@@ -15,7 +15,7 @@ require "active_resource/railtie"
# If you have a Gemfile, require the default gems, the ones in the
# current environment and also include :assets gems if in development
# or test environments.
Bundler.require *Rails.groups(:assets => %w(development test)) if defined?(Bundler)
Bundler.require *Rails.groups(:assets) if defined?(Bundler)
module <%= app_const_base %>
class Application < Rails::Application