class Importmap::Map
def to_json(resolver:, cache_key: :json)
want these resolved paths to use. In case you need to resolve for different asset hosts, you can pass in a custom
`ApplicationController.helpers`. You'll want to use the resolver that has been configured for the `asset_host` you
The `resolver` must respond to `path_to_asset`, such as `ActionController::Base.helpers` or
Returns a JSON hash (as a string) of all the resolved module paths of the pinned packages in the import map format.
def to_json(resolver:, cache_key: :json) cache_as(cache_key) do JSON.pretty_generate({ "imports" => resolve_asset_paths(expanded_packages_and_directories, resolver: resolver) }) end end