-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore :assets group in Gemfile #250
base: master
Are you sure you want to change the base?
Conversation
Some of those gems (especially mini_racer) are very large, and it is useful to be able to skip them. They were already in a commented-out group; restore the group to allow skipping them (they will still be installed by default). Note that putting them in a group will mean they won't be auto-required when config/application.rb calls `Bundler.require(:default, Rails.env)`, but that should be fine. Also remove the old comment "not required in production environments by default" because it is unclear/inaccurate (we currently run the asset precompilation on the production server), and add hints on how to skip the group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure I fully understand why, but the assets group was removed in Rails 4:
- https://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-3-2-to-rails-4-0-gemfile
- https://stackoverflow.com/questions/16406204/why-did-rails4-drop-support-for-assets-group-in-the-gemfile
- rails/rails@49c4af4
And this doesn't seem ideal, but we might be compiling some assets live in production mode; not sure if that could cause issues with this:
nztrain/config/environments/production.rb
Lines 59 to 60 in b084e51
# Don't fallback to assets pipeline | |
# config.assets.compile = false |
Good catch, what a mess. Just wanted to skip some gems...
I hope that can be dealt with separately? (The gems will still be installed in production, just won't be auto-required by default; I'll try to confirm that live compilation still works with that change.) |
Feel free to merge this if you don't find any issues.
Some of those gems (especially mini_racer) are very large, and it is useful to be able to skip them. They were already in a commented-out group; restore the group to allow skipping them (they will still be installed by default).
Note that putting them in a group will mean they won't be auto-required when config/application.rb calls
Bundler.require(:default, Rails.env)
, but that should be fine.Also remove the old comment "not required in production environments by default" because it is unclear/inaccurate (we currently run the asset precompilation on the production server), and add hints on how to skip the group.