Skip to content

Commit

Permalink
Turn off JS Minification for Heroku
Browse files Browse the repository at this point in the history
Given the outcome of [#123] and [#124], we don't take a stand on where
minification should happen.

However, to make sure that Heroku deployments don't take too long, the
generator can disable Rails-side minification.

The benefit of doing this in the generator (as opposed to automatically
in [the addon]) is that the change will introduce diff noise, which is
explicit and easy to back out of.

[#123]: #123
[#124]: #124
[the addon]: https://github.com/rondale-sc/ember-cli-rails-addon/blob/2f2a47efe6e81a2bcd43ec9ff0f89fc18bed5a03/index.js#L25-L32
  • Loading branch information
seanpdoyle committed Nov 5, 2015
1 parent 3703693 commit 3ea4218
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/generators/ember-cli/heroku/heroku_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ def copy_setup_heroku_file
run "chmod a+x bin/heroku_install"
end

def config_js_compressor
production_config = "config/environments/production.rb"

inject_into_file production_config, before: "end\n" do
<<-RUBY
config.assets.js_compressor = nil
RUBY
end
end

def inject_12factor_gem
gem "rails_12factor", group: [:staging, :production]
end
Expand Down

0 comments on commit 3ea4218

Please sign in to comment.