Skip to content

Commit

Permalink
When resolving source maps, ignore leading dirname
Browse files Browse the repository at this point in the history
These  may be outputted by esbuild when using its `--public-path` option
  • Loading branch information
gjtorikian committed Sep 2, 2023
1 parent dd32663 commit 52c06d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/propshaft/compiler/source_mapping_urls.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "propshaft/compiler"

class Propshaft::Compiler::SourceMappingUrls < Propshaft::Compiler
SOURCE_MAPPING_PATTERN = %r{^(//|/\*)# sourceMappingURL=(.+\.map)}
SOURCE_MAPPING_PATTERN = %r{^(//|/\*)# sourceMappingURL=(?:.*\/)?(.*\.map)}

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

0 comments on commit 52c06d1

Please sign in to comment.