Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
bdarcet committed Oct 21, 2022
1 parent 087a320 commit 1ac44d1
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/redis_web_manager/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,20 @@ module RedisWebManager
class Engine < ::Rails::Engine
isolate_namespace RedisWebManager

path = Engine.root.join('app', 'assets', 'config')
config.assets.precompile << "#{path}/redis_web_manager_manifest.js"
initializer 'redis_web_manager.assets.precompile' do |app|
config.assets.precompile << "#{path}/redis_web_manager_manifest.js"
# check if Rails api mode
if app.config.respond_to?(:assets)
if defined?(Sprockets) && Sprockets::VERSION >= '4'
app.config.assets.precompile << 'redis_web_manager/application.js'
app.config.assets.precompile << 'redis_web_manager/application.css'
else
# use a proc instead of a string
app.config.assets.precompile << proc { |path| path == 'redis_web_manager/application.js' }
app.config.assets.precompile << proc { |path| path == 'redis_web_manager/application.css' }
end
end
end

config.generators do |generate|
# Don't generate assets
Expand Down

0 comments on commit 1ac44d1

Please sign in to comment.