evanw / esbuild

An extremely fast bundler for the web
https://esbuild.github.io/
MIT License
38.22k stars 1.16k forks source link

URL encoding link to map files #3982

Open sorskoot opened 6 days ago

sorskoot commented 6 days ago

Issue

When a space is present in the filename of a Javascript file, this space also appears in the link to the map file at the end of a bundle. Like //# sourceMappingURL=Some Random File.js.map. This will result in the map file not being found.

Expected behavior

By encoding it correctly there are now actual spaces anymore and the browser can show the correct file //# sourceMappingURL=Some%20Random%20File.js.map