Skip to content

Commit

Permalink
Update WebpackerLite 2.1 fixes server rendering
Browse files Browse the repository at this point in the history
Uses new helper pack_path to get the path of the server bundle without
worrying about any CDN set in the asset_host.
  • Loading branch information
justin808 committed Jul 19, 2017
1 parent 41e4c06 commit f34a16d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ gem "chromedriver-helper"
gem "launchy"
gem "poltergeist"
gem "selenium-webdriver"
gem "webpacker_lite"
gem "webpacker_lite", "~> 2.1"

gem "rainbow"
3 changes: 2 additions & 1 deletion lib/react_on_rails/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def self.bundle_js_file_path(bundle_name)

if using_webpacker_lite? && WebpackerLite::Manifest.lookup(bundle_name)
# If using webpacker_lite gem
public_subdir_hashed_file_name = ActionController::Base.helpers.asset_pack_path(bundle_name)
# Per https://github.com/rails/webpacker/issues/571, this path might
public_subdir_hashed_file_name = ActionController::Base.helpers.pack_path(bundle_name)
return File.join("public", public_subdir_hashed_file_name)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ gem "sdoc", group: :doc

gem "react_on_rails", path: "../.."

gem "webpacker_lite", "2.0.4"
gem "webpacker_lite", "2.1.0"

gem "mini_racer"

Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ GEM
uglifier (3.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.2.1)
webpacker_lite (2.0.4)
webpacker_lite (2.1.0)
activesupport (>= 4.2)
multi_json (~> 1.2)
railties (>= 4.2)
Expand Down Expand Up @@ -326,7 +326,7 @@ DEPENDENCIES
sqlite3
turbolinks (~> 5.0)
uglifier
webpacker_lite (= 2.0.4)
webpacker_lite (= 2.1.0)

BUNDLED WITH
1.15.1

0 comments on commit f34a16d

Please sign in to comment.