File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,11 @@ module React
22 module Rails
33 class Engine < ::Rails ::Engine
44 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
610 end
711 end
812 end
Original file line number Diff line number Diff line change @@ -38,10 +38,12 @@ class Railtie < ::Rails::Railtie
3838 addons : app . config . react . addons ,
3939 } )
4040
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+
4547 end
4648
4749 config . before_initialize do |app |
You can’t perform that action at this time.
0 commit comments