Permalink
Browse files

Merge pull request #25919 from benpickles/skip-javascript-also-skips-…

…uglifier

Uglifier should not be included when generating a new app with `--skip-javascript`
  • Loading branch information...
guilleiguaran committed Jul 26, 2016
2 parents 49315e2 + 09ed4e9 commit cbc61f513641ef3c311d671c322dc93f2d37d7fc
View
@@ -1,3 +1,7 @@
* A generated app should not include Uglifier with `--skip-javascript` option.
*Ben Pickles*
* Set session store to cookie store internally and remove the initializer from
the generated app.
@@ -299,9 +299,11 @@ def assets_gemfile_entry
gems << GemfileEntry.github('sass-rails', 'rails/sass-rails', nil,
'Use SCSS for stylesheets')
gems << GemfileEntry.version('uglifier',
'>= 1.3.0',
'Use Uglifier as compressor for JavaScript assets')
if !options[:skip_javascript]
gems << GemfileEntry.version('uglifier',
'>= 1.3.0',
'Use Uglifier as compressor for JavaScript assets')
end
gems
end
@@ -19,8 +19,12 @@ Rails.application.configure do
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
<%- unless options.skip_sprockets? -%>
<%- if options.skip_javascript? -%>
# Compress CSS.
<%- else -%>
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
<%- end -%>
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
@@ -468,6 +468,11 @@ def test_javascript_is_skipped_if_required
assert_file "Gemfile" do |content|
assert_no_match(/coffee-rails/, content)
assert_no_match(/jquery-rails/, content)
assert_no_match(/uglifier/, content)
end
assert_file "config/environments/production.rb" do |content|
assert_no_match(/config\.assets\.js_compressor = :uglifier/, content)
end
end

0 comments on commit cbc61f5

Please sign in to comment.