File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 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
2828 end
2929 end
3030
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+
3141 config . before_initialize do |app |
3242 # We want to include different files in dev/prod. The development builds
3343 # contain console logging for invariants and logging to help catch
@@ -41,14 +51,6 @@ class Railtie < ::Rails::Railtie
4151 end
4252
4353 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-
5254 # The class isn't accessible in the configure block, so assign it here if it wasn't overridden:
5355 app . config . react . server_renderer ||= React ::ServerRendering ::SprocketsRenderer
5456
You can’t perform that action at this time.
0 commit comments