Skip to content

Commit

Permalink
Merge pull request #1 from joeyparis/webpacker-manifest-asset-path
Browse files Browse the repository at this point in the history
🐛 Fix bug that prevents loading assets with `webpacker-dev-server`
  • Loading branch information
joeyparis authored Nov 6, 2017
2 parents b3fac2c + 649b1b6 commit 987c5c1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/react/server_rendering/webpacker_manifest_container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def find_asset(logical_path)
asset_path = Webpacker.manifest.lookup(logical_path).to_s
if Webpacker.dev_server.running?
ds = Webpacker.dev_server
# Remove the protocol and host from the asset path. Sometimes webpacker includes this, sometimes it does not
asset_path.slice!("#{ds.protocol}://#{ds.host_with_port}")
dev_server_asset = open("#{ds.protocol}://#{ds.host_with_port}#{asset_path}").read
dev_server_asset.sub!(CLIENT_REQUIRE, '//\0')
dev_server_asset
Expand Down

0 comments on commit 987c5c1

Please sign in to comment.