From 1dbddafde06e08fe3335a45031ab67d886a64d78 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Mon, 4 May 2015 17:15:36 -0400 Subject: [PATCH] Include react-rails settings in the sprockets version --- lib/react/rails/railtie.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/react/rails/railtie.rb b/lib/react/rails/railtie.rb index cf5a8a8f0..362e3685f 100644 --- a/lib/react/rails/railtie.rb +++ b/lib/react/rails/railtie.rb @@ -41,6 +41,14 @@ class Railtie < ::Rails::Railtie end config.after_initialize do |app| + variant = app.config.react.variant == :production ? 'production' : 'development' + variant += '-with-addons' if app.config.react.addons + + app.assets.version = [ + app.assets.version, + "react-#{variant}", + ].compact.join('-') + # Server Rendering # Concat component_filenames together for server rendering app.config.react.components_js = lambda {