Skip to content

Commit c583d9c

Browse files
committed
Split source map paths as absolute/relative
1 parent 2781167 commit c583d9c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/propshaft/compiler/source_mapping_urls.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ def compile(asset, input)
1111

1212
private
1313
def asset_path(source_mapping_url, logical_path)
14-
source_mapping_url = ::File.basename(source_mapping_url)
14+
source_mapping_url.gsub!(/^(.+\/)?#{url_prefix}\//, "/")
15+
source_mapping_path = Pathname.new(source_mapping_url)
1516

16-
if logical_path.dirname.to_s == "."
17-
source_mapping_url
17+
if source_mapping_path.absolute?
18+
source_mapping_url.sub(/^\//, "")
1819
else
1920
logical_path.dirname.join(source_mapping_url).to_s
2021
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
var fun; //# sourceMappingURL=/assets/sourceMappingURL-already-prefixed-nested.js.map
1+
var fun; //# sourceMappingURL=/assets/nested/sourceMappingURL-already-prefixed-nested.js.map

0 commit comments

Comments
 (0)