File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ module React
2
2
module Rails
3
3
class Engine < ::Rails ::Engine
4
4
initializer "react_rails.setup_engine" , :group => :all do |app |
5
- app . assets . register_engine '.jsx' , React ::JSX ::Template
5
+ sprockets_env = app . assets || Sprockets # Sprockets 3.x expects this in a different place
6
+ sprockets_env . register_engine ( ".jsx" , React ::JSX ::Template )
6
7
end
7
8
end
8
9
end
Original file line number Diff line number Diff line change @@ -38,10 +38,9 @@ class Railtie < ::Rails::Railtie
38
38
addons : app . config . react . addons ,
39
39
} )
40
40
41
- app . assets . version = [
42
- app . assets . version ,
43
- "react-#{ asset_variant . react_build } " ,
44
- ] . compact . join ( '-' )
41
+ sprockets_env = app . assets || app . config . assets # sprockets-rails 3.x attaches this at a different config
42
+ sprockets_env . version = [ sprockets_env . version , "react-#{ asset_variant . react_build } " , ] . compact . join ( '-' )
43
+
45
44
end
46
45
47
46
config . before_initialize do |app |
You can’t perform that action at this time.
0 commit comments