Skip to content

Commit 1dbddaf

Browse files
committed
Include react-rails settings in the sprockets version
1 parent 67e8ffa commit 1dbddaf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/react/rails/railtie.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ class Railtie < ::Rails::Railtie
4141
end
4242

4343
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+
4452
# Server Rendering
4553
# Concat component_filenames together for server rendering
4654
app.config.react.components_js = lambda {

0 commit comments

Comments
 (0)