Class: Webpack::Rails::React::Manifest
- Inherits:
-
Object
- Object
- Webpack::Rails::React::Manifest
- Defined in:
- lib/webpack/rails/react/manifest.rb
Overview
Webpack manifest loading, caching & entry point retrieval
Defined Under Namespace
Classes: EntryPointMissingError, ManifestLoadError
Class Method Summary collapse
-
.asset_paths(source) ⇒ Object
:nodoc:.
Class Method Details
.asset_paths(source) ⇒ Object
:nodoc:
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/webpack/rails/react/manifest.rb', line 22 def asset_paths(source) paths = manifest["assetsByChunkName"][source] if paths # Can be either a string or an array of strings. # Do not include source maps as they are not javascript [paths].flatten.reject { |p| p =~ /.*\.map$/ }.map do |p| "/#{::Rails.configuration.webpack.public_path}/#{p}" end else raise EntryPointMissingError, "Can't find entry point '#{source}' in webpack manifest" end end |