Skip to content

Commit f292419

Browse files
committed
only require sprockets when ENV[SPROCKETS] == 'true'
1 parent 464db65 commit f292419

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ gemspec
1515
gem "activeadmin"
1616
gem "mimemagic", github: "mimemagicrb/mimemagic", ref: "01f92d86d15d85cfd0f20dabd025dcbd36a8a60f"
1717

18+
gem "sassc", require: ENV["SPROCKETS"] == "true"
19+
gem "sassc-rails", require: ENV["SPROCKETS"] == "true"
1820
gem "webpacker", "~> 5.0", require: ENV["SPROCKETS"] != "true"

lib/activeadmin_addons/engine.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
module ActiveAdminAddons
22
module Rails
33
class Engine < ::Rails::Engine
4+
if ENV["SPROCKETS"] == "true"
5+
require 'sassc'
6+
require 'sassc-rails'
7+
end
48
require "xdan-datetimepicker-rails"
59
require "require_all"
610
require "active_material"
@@ -9,7 +13,7 @@ class Engine < ::Rails::Engine
913
require_rel "support"
1014
require_rel "addons"
1115
require_rel "active_admin_config"
12-
app.config.assets.precompile += %w(fileicons/*.png switches/switch_*.png
16+
app.config.assets.precompile += %w(select.scss fileicons/*.png switches/switch_*.png
1317
material/icons *.svg)
1418
end
1519
end

0 commit comments

Comments
 (0)