module Webpacker::Helper

def asset_pack_path(name, **options)

<%= asset_pack_path 'calendar.css' %> # => "/packs/calendar-1016838bab065ae1e122.css"
# When extract_css is true in webpacker.yml or the file is not a css:

<%= asset_pack_path 'calendar.css' %> # => nil
# When extract_css is false in webpacker.yml and the file is a css:

Example:

This will use asset_path internally, so most of their behaviors will be the same.
Return relative path using manifest.json and passes it to asset_path helper.
Computes the relative path for a given Webpacker asset.
def asset_pack_path(name, **options)
  if current_webpacker_instance.config.extract_css? || !stylesheet?(name)
    asset_path(current_webpacker_instance.manifest.lookup!(name), **options)
  end
end