Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added old rails manifest.json support #436

Merged
merged 1 commit into from
May 27, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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