diff --git a/lib/react_on_rails/helper.rb b/lib/react_on_rails/helper.rb index fa3159dd7..eec0bec95 100644 --- a/lib/react_on_rails/helper.rb +++ b/lib/react_on_rails/helper.rb @@ -362,13 +362,13 @@ def load_pack_for_generated_component(react_component_name, render_options) ReactOnRails::PackerUtils.raise_nested_entries_disabled unless ReactOnRails::PackerUtils.nested_entries? append_javascript_pack_tag("client-bundle") - # if Rails.env.development? - # is_component_pack_present = File.exist?(generated_components_pack_path(react_component_name)) - # raise_missing_autoloaded_bundle(react_component_name) unless is_component_pack_present - # end - # append_javascript_pack_tag("generated/#{react_component_name}", - # defer: ReactOnRails.configuration.defer_generated_component_packs) - # append_stylesheet_pack_tag("generated/#{react_component_name}") + if Rails.env.development? + is_component_pack_present = File.exist?(generated_components_pack_path(react_component_name)) + raise_missing_autoloaded_bundle(react_component_name) unless is_component_pack_present + end + append_javascript_pack_tag("generated/#{react_component_name}", + defer: ReactOnRails.configuration.defer_generated_component_packs) + append_stylesheet_pack_tag("generated/#{react_component_name}") end # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity