Class: WebpackIntegration::Assets
- Inherits:
-
Object
- Object
- WebpackIntegration::Assets
- Defined in:
- lib/webpack_integration/assets.rb
Class Method Summary collapse
- .configuration ⇒ Object
- .file_matcher ⇒ Object
- .generate_assets_manifest ⇒ Object
- .public_folder ⇒ Object
- .webpack_folder ⇒ Object
Class Method Details
.configuration ⇒ Object
27 28 29 |
# File 'lib/webpack_integration/assets.rb', line 27 def self.configuration WebpackIntegration.configuration end |
.file_matcher ⇒ Object
15 16 17 |
# File 'lib/webpack_integration/assets.rb', line 15 def self.file_matcher File.join(configuration.full_path, '**/**/**/**') end |
.generate_assets_manifest ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/webpack_integration/assets.rb', line 3 def self.generate_assets_manifest {}.tap do |res| Dir[file_matcher].each do |f| next if File.directory?(f) key = f.gsub(webpack_folder, '') key = key.gsub(/-[a-f\d]*(\.)/, '.') # remove md5 hash value = f.sub(public_folder, '') res[key] = value end end end |
.public_folder ⇒ Object
23 24 25 |
# File 'lib/webpack_integration/assets.rb', line 23 def self.public_folder configuration.public_folder end |
.webpack_folder ⇒ Object
19 20 21 |
# File 'lib/webpack_integration/assets.rb', line 19 def self.webpack_folder @webpack_folder ||= File.join(configuration.full_path, '/') end |