module Webpacker::Helper
def asset_pack_url(name, **options)
# In production mode:
<%= asset_pack_url 'calendar.css' %> # => nil
# In development mode with hot module replacement:
Example:
This will use asset_url internally, so most of their behaviors will be the same.
Return absolute path using manifest.json and passes it to asset_url helper
Computes the absolute path for a given Webpacker asset.
def asset_pack_url(name, **options) unless Webpacker.dev_server.running? && Webpacker.dev_server.hot_module_replacing? asset_url(Webpacker.manifest.lookup!(name), **options) end end