load_asset_gems.rb 425 B

123456789101112
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. # Only load gems for asset compilation if they are needed to avoid
  3. # having unneeded runtime dependencies like NodeJS.
  4. if ArgvHelper.argv.any? { |e| e.start_with? 'assets:' } || Rails.groups.exclude?('production')
  5. Bundler
  6. .load
  7. .current_dependencies
  8. .each do |dep|
  9. require dep.name if dep.groups.include?(:assets)
  10. end
  11. end