Module: Webpack::Helpers

Included in:
Rails::Helpers
Defined in:
lib/webpack/helpers.rb,
lib/webpack/helpers/version.rb

Constant Summary collapse

VERSION =
"0.1.3"

Instance Method Summary collapse

Instance Method Details

#webpack_bundle_path(entry) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/webpack/helpers.rb', line 7

def webpack_bundle_path(entry)
  lookuped = URI.parse(Webpack.manifest.lookup(entry) || entry)
  prefix = Webpack.config.dev_server.proxy_path

  return lookuped.to_s unless lookuped.host.nil? && prefix

  Pathname.new("/#{prefix}/#{lookuped}").cleanpath.to_s
end