Class: Webpack::Manifest
- Inherits:
-
Object
- Object
- Webpack::Manifest
- Includes:
- Singleton
- Defined in:
- lib/webpack/manifest.rb
Instance Attribute Summary collapse
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
6 7 8 |
# File 'lib/webpack/manifest.rb', line 6 def updated_at @updated_at end |
Class Method Details
.configure {|configuration| ... } ⇒ Object
11 12 13 |
# File 'lib/webpack/manifest.rb', line 11 def self.configure yield configuration end |
Instance Method Details
#asset_url(filename) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/webpack/manifest.rb', line 15 def asset_url(filename) name = filename.split('.').first ext = filename.split('.').last chunk = [*data['assetsByChunkName'][name]] asset_name = chunk.find { |asset| asset.end_with? ext } "#{host}#{asset_name}" if asset_name end |
#host ⇒ Object
26 27 28 |
# File 'lib/webpack/manifest.rb', line 26 def host data['publicPath'] end |