Module: Isorun::Resolver

Defined in:
lib/isorun/resolver.rb

Constant Summary collapse

SSR_APP_RESOLVER =
lambda { |bundle_id|
  if Rails.env.development?
    Rails.root.join("app", "assets", "builds", "#{bundle_id}-server.js").to_s
  else
    Isorun::Resolver.module_path("#{bundle_id}-server")
  end
}
SSR_VITE_APP_RESOLVER =
lambda { |_bundle_id|
  Rails.public_path.join("vite-ssr/ssr.js").to_s
}
SIMPLE_RESOLVER =
lambda { |bundle_id|
  if Rails.env.development?
    Rails.root.join("app", "assets", "builds", "#{bundle_id}.js").to_s
  else
    Isorun::Resolver.module_path(bundle_id)
  end
}

Class Method Summary collapse

Class Method Details

.module_path(asset) ⇒ Object



25
26
27
28
# File 'lib/isorun/resolver.rb', line 25

def self.module_path(asset)
  file = Rails.application.assets_manifest.assets["#{asset}.js"]
  "#{Rails.application.assets_manifest.directory}/#{file}"
end