module Webpacker::Helper
def asset_pack_path(name, **options)
# In production mode:
<%= asset_pack_path 'calendar.css' %> # => nil
# In development mode with hot module replacement:
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) unless stylesheet?(name) && Webpacker.dev_server.running? && Webpacker.dev_server.hot_module_replacing? asset_path(Webpacker.manifest.lookup!(name), **options) end end