Skip to content

Commit

Permalink
added old rails manifest.json support
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeuler committed May 26, 2016
1 parent 4f05cf4 commit 42f310b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/tasks/assets.rake
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ namespace :react_on_rails do
desc "Creates non-digested symlinks for the assets in the public asset dir"
task symlink_non_digested_assets: :"assets:environment" do
if ReactOnRails.configuration.symlink_non_digested_assets_regex
manifest_path = Dir.glob(ReactOnRails::assets_path
.join(".sprockets-manifest-*.json"))
.first
manifest_glob = Dir.glob(ReactOnRails::assets_path.join(".sprockets-manifest-*.json")) +
Dir.glob(ReactOnRails::assets_path.join("manifest-*.json"))
if manifest_glob.empty?
puts "Warning: React On Rails: expected to find .sprockets-manifest-*.json or manifest-*.json "\
"at #{ReactOnRails::assets_path}, but found none. Canceling symlinking tasks."
next
end
manifest_path = manifest_glob.first
manifest_data = JSON.load(File.new(manifest_path))

manifest_data["assets"].each do |logical_path, digested_path|
Expand Down

0 comments on commit 42f310b

Please sign in to comment.