module Esbuilder::Helper

Public Instance Methods

entry_point_tag(*entry_points, **options) click to toggle source
# File lib/esbuilder/helper.rb, line 5
def entry_point_tag(*entry_points, **options)
  files = build(*entry_points)
  files.map do |file|
    if file.end_with?(".js")
      javascript_include_tag file, **options
    elsif file.end_with?(".css")
      stylesheet_link_tag file, **options
    else
      # Ignore non-js/css files
      ""
    end
  end.join("\n").html_safe
end

Private Instance Methods

build(*entry_points) click to toggle source
# File lib/esbuilder/helper.rb, line 21
def build(*entry_points)
  entry_points.reduce(Set.new) { |result, entry_point| result.merge Esbuilder.entry_point_to_outputs(entry_point) }
end