提交 3da3df8f 编写于 作者: J José Valim

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

上级 d5e87226
...@@ -70,8 +70,13 @@ def asset_environment(app) ...@@ -70,8 +70,13 @@ def asset_environment(app)
if assets.compress if assets.compress
# temporarily hardcode default JS compressor to uglify. Soon, it will work # temporarily hardcode default JS compressor to uglify. Soon, it will work
# the same as SCSS, where a default plugin sets the default. # the same as SCSS, where a default plugin sets the default.
env.js_compressor = LazyCompressor.new { expand_js_compressor(assets.js_compressor || :uglifier) } unless assets.js_compressor == false
env.css_compressor = LazyCompressor.new { expand_css_compressor(assets.css_compressor) } 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 end
env env
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
# If you have a Gemfile, require the default gems, the ones in the # If you have a Gemfile, require the default gems, the ones in the
# current environment and also include :assets gems if in development # current environment and also include :assets gems if in development
# or test environments. # 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 %> module <%= app_const_base %>
class Application < Rails::Application class Application < Rails::Application
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册