14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/proscenium/manifest.rb', line 14
def load!
public_path = Rails.configuration.paths['public'].first
self.manifest = {}
self.loaded = false
if Proscenium.config.manifest_path.exist?
self.loaded = true
JSON.parse(Proscenium.config.manifest_path.read)['outputs'].each do |outpath, details|
next if !details.key?('entryPoint')
outpath = outpath.delete_prefix "#{public_path}/"
ep = details['entryPoint']
ep = if (gem = BundledGems.paths.find { |_, v| ep.start_with? "#{v}/" })
"@rubygems/#{gem[0]}#{ep.delete_prefix(gem[1])}"
else
ep.delete_prefix(Rails.root.to_s)
end
manifest[ep] = "/#{outpath}"
end
end
manifest
end
|