File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,11 @@ 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
+ if app . assets . nil?
6
+ app . config . assets . register_engine '.jsx' , React ::JSX ::Template
7
+ else
8
+ app . assets . register_engine '.jsx' , React ::JSX ::Template
9
+ end
6
10
end
7
11
end
8
12
end
Original file line number Diff line number Diff line change @@ -38,10 +38,12 @@ 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
+ if app . assets . nil?
42
+ app . config . assets . version = [ app . config . assets . version , "react-#{ asset_variant . react_build } " , ] . compact . join ( '-' )
43
+ else
44
+ app . assets . version = [ app . assets . version , "react-#{ asset_variant . react_build } " , ] . compact . join ( '-' )
45
+ end
46
+
45
47
end
46
48
47
49
config . before_initialize do |app |
You can’t perform that action at this time.
0 commit comments