Class: Propshaft::Compiler::SourceMappingUrls

Inherits:
Propshaft::Compiler show all
Defined in:
lib/propshaft/compiler/source_mapping_urls.rb

Constant Summary collapse

SOURCE_MAPPING_PATTERN =
%r{(//|/\*)# sourceMappingURL=(.+\.map)(\s*?\*\/)?\s*?\Z}

Instance Attribute Summary

Attributes inherited from Propshaft::Compiler

#assembly

Instance Method Summary collapse

Methods inherited from Propshaft::Compiler

#initialize

Constructor Details

This class inherits a constructor from Propshaft::Compiler

Instance Method Details

#compile(logical_path, input) ⇒ Object



8
9
10
# File 'lib/propshaft/compiler/source_mapping_urls.rb', line 8

def compile(logical_path, input)
  input.gsub(SOURCE_MAPPING_PATTERN) { source_mapping_url(asset_path($2, logical_path), $1, $3) }
end