class

Importmap::Map

Inherits Reference < Object

Class methods

root

Корень для относительных dir в pin_all_from (аналог Rails.root).

Source
root=(root : String)

Корень для относительных dir в pin_all_from (аналог Rails.root).

Source

Instance methods

clear_cache
Source
digest(resolver : AssetResolver) : String

SHA1 от to_json — для etag (как в геме).

Source
directories
draw

Block-DSL вместо instance_eval-конфига (см. отклонения):

Importmap.map.draw do |map| map.pin "application" map.pin_all_from "app/javascript/controllers", under: "controllers" end

Source
packages
pin(name : String, to : String | Nil = nil, preload : Preload = true) : Nil
Source
pin_all_from(dir : String, under : String | Nil = nil, to : String | Nil = nil, preload : Preload = true) : Nil
Source
preloaded_module_paths(resolver : AssetResolver, entry_point : EntryPoint = "application", cache_key : String = "preloaded_module_paths") : Array(String)

Пути модулей с preload: true (или совпадающим entry_point), в порядке определения.

Source
to_json(resolver : AssetResolver, cache_key : String = "json") : String

Pretty-JSON import map: {"imports": {name → resolved path}}.

Source

Nested types