Skip to content

Commit b36413d

Browse files
Update server bundle path resolution to utilize public output path
- Modified the candidate paths logic to include the public output path from PackerUtils when `enforce_private_server_bundles` is not active. - This change enhances the flexibility of server bundle path resolution, ensuring that the system can effectively locate bundles in the public directory when appropriate. This update builds on previous enhancements to improve asset management and aligns with the ongoing refactoring efforts in the project.
1 parent 369f5a7 commit b36413d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/react_on_rails/utils.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ def self.bundle_js_file_path(bundle_name)
123123
if is_server_bundle && config.server_bundle_output_path.present?
124124
candidate_paths = [File.expand_path(File.join(root_path, config.server_bundle_output_path, bundle_name))]
125125
unless config.enforce_private_server_bundles
126-
candidate_paths << File.expand_path(File.join(root_path, config.server_bundle_output_path, bundle_name))
126+
candidate_paths << File.expand_path(File.join(ReactOnRails::PackerUtils.packer_public_output_path,
127+
bundle_name))
127128
end
128129

129130
candidate_paths.each do |path|

0 commit comments

Comments
 (0)