Skip to content

Commit eb0469e

Browse files
author
Steffen van Bergerem
committed
Add support for Sprockets 3.x
1 parent 5848f32 commit eb0469e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/js_image_paths/engine.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ class Engine < Rails::Engine
44
isolate_namespace(JsImagePaths)
55

66
initializer('js_image_paths.compile', after: 'sprockets.environment') do |application|
7-
application.assets.register_preprocessor('application/javascript', :'js_image_path.compile') do |context, data|
7+
sprockets_env = application.assets || Sprockets
8+
sprockets_env.register_preprocessor('application/javascript', :'js_image_path.compile') do |context, data|
89
if context.logical_path == 'js_image_paths'
910
JsImagePaths::Generator.context = context
1011
end

0 commit comments

Comments
 (0)