File tree 1 file changed +10
-8
lines changed
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,16 @@ class Railtie < ::Rails::Railtie
28
28
end
29
29
end
30
30
31
+ initializer "react_rails.bust_cache" , group : :all do |app |
32
+ variant = app . config . react . variant == :production ? 'production' : 'development'
33
+ variant += '-with-addons' if app . config . react . addons
34
+
35
+ app . assets . version = [
36
+ app . assets . version ,
37
+ "react-#{ variant } " ,
38
+ ] . compact . join ( '-' )
39
+ end
40
+
31
41
config . before_initialize do |app |
32
42
# We want to include different files in dev/prod. The development builds
33
43
# contain console logging for invariants and logging to help catch
@@ -41,14 +51,6 @@ class Railtie < ::Rails::Railtie
41
51
end
42
52
43
53
config . after_initialize do |app |
44
- variant = app . config . react . variant == :production ? 'production' : 'development'
45
- variant += '-with-addons' if app . config . react . addons
46
-
47
- app . assets . version = [
48
- app . assets . version ,
49
- "react-#{ variant } " ,
50
- ] . compact . join ( '-' )
51
-
52
54
# The class isn't accessible in the configure block, so assign it here if it wasn't overridden:
53
55
app . config . react . server_renderer ||= React ::ServerRendering ::SprocketsRenderer
54
56
You can’t perform that action at this time.
0 commit comments