module Webpack::ViewHelpers

Public Instance Methods

webpack_context() click to toggle source
# File lib/webpack/view_helpers.rb, line 3
def webpack_context
  Context.new(self)
end
webpack_css_tag(name, **options) click to toggle source

@param name [String]

# File lib/webpack/view_helpers.rb, line 13
def webpack_css_tag(name, **options)
  stylesheet_link_tag(webpack_entry_url(name, :css), options) if Webpack.config.extract_css
end
webpack_entry_url(name, ext) click to toggle source

@param name [String] @param ext [String] @return [String]

# File lib/webpack/view_helpers.rb, line 20
def webpack_entry_url(name, ext)
  webpack_context.entry_url(name, ext)
end
webpack_js_tag(name, **options) click to toggle source

@param name [String]

# File lib/webpack/view_helpers.rb, line 8
def webpack_js_tag(name, **options)
  javascript_include_tag(webpack_entry_url(name, :js), options)
end
webpack_static_file_url(path) click to toggle source

@param path [String] @return [String]

# File lib/webpack/view_helpers.rb, line 26
def webpack_static_file_url(path)
  webpack_context.static_file_url(path)
end