class Importmap::Map
def cache_sweeper(watches: nil)
when the directories passed on initialization via `watches:` have changes. This is used in development
Returns an instance of ActiveSupport::EventedFileUpdateChecker configured to clear the cache of the map
def cache_sweeper(watches: nil) if watches @cache_sweeper = Rails.application.config.file_watcher.new([], Array(watches).collect { |dir| [ dir.to_s, "js"] }.to_h) do clear_cache end else @cache_sweeper end end