Skip to content

Commit 260cb28

Browse files
committed
Append assets path on before_initialize
1 parent 07eec91 commit 260cb28

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/react/rails/railtie.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Railtie < ::Rails::Railtie
2828
end
2929
end
3030

31-
config.after_initialize do |app|
31+
config.before_initialize do |app|
3232
# We want to include different files in dev/prod. The development builds
3333
# contain console logging for invariants and logging to help catch
3434
# common mistakes. These are all stripped out in the production build.
@@ -38,7 +38,9 @@ class Railtie < ::Rails::Railtie
3838

3939
app.assets.append_path(root_path.join('lib/assets/react-source/').join(directory).to_s)
4040
app.assets.append_path(root_path.join('lib/assets/javascripts/').to_s)
41+
end
4142

43+
config.after_initialize do |app|
4244
# Server Rendering
4345
# Concat component_filenames together for server rendering
4446
app.config.react.components_js = lambda {

0 commit comments

Comments
 (0)