Method: Webpacker::Manifest#lookup

Defined in:
lib/webpacker/manifest.rb

#lookup(name, pack_type = {}) ⇒ Object

Computes the relative path for a given Webpacker asset using manifest.json. If no asset is found, returns nil.

Example:

Webpacker.manifest.lookup('calendar.js') # => "/packs/calendar-1016838bab065ae1e122.js"


41
42
43
44
45
# File 'lib/webpacker/manifest.rb', line 41

def lookup(name, pack_type = {})
  compile if compiling?

  find(full_pack_name(name, pack_type[:type]))
end