question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sourceMappingURL comment included in unmapped size

See original GitHub issue

Description The number of unmapped bytes changes with the filename of the source map file.

Steps to reproduce

  1. Build any bundle with a source map
  2. Load source-map-explorer, save the number of unmapped bytes
  3. Change the name of the source map itself and the name inside sourceMappingURL comment inside the bundle
  4. Load source-map-explorer
  5. See a different number of unmapped bytes

Files to reproduce It’s a TAR archive, despite the name. dist.zip

Expected behavior Unmapped bytes number does not depend on the name length of the source map file.

Environment

  • OS: MacOS X 10.14.6, node 11.15.0
  • source-map-explorer 2.0.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
nikolay-borzovcommented, Nov 13, 2019

On second thought, I think we should include source map comment into size analysis. One of key use cases of SME - figure out what takes most space in the bundle size. Seeing that bundle contains an inline source map might help to reduce the bundle size

0reactions
nikolay-borzovcommented, Nov 13, 2019

But we should also add an option to exclude source map comments from size calculation. This way the user decides and aware that the result size might be smaller. @danvk, regarding message in the console - I’m not sure we should add one. Look at the deluge of confusion caused by “Your source map only contains one source” message.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Analyzing Angular bundle with Source Map Explorer
As far as I know, duplicated bundles does not increase bundle size. They should be included once if imported in many places. 1 ......
Read more >
Troubleshooting Source Maps for JavaScript
Verify sourceMappingURL is present. Some CDNs automatically strip comments from static files, including JavaScript files. This can have the effect of stripping ...
Read more >
API - esbuild
This mode means the source map is appended to the end of the .js output file as a base64 payload inside a //#...
Read more >
Warning: -file- is being assigned a //# sourceMappingURL, but ...
There are two ways to assign a source map, either by using a comment or by setting a header to the JavaScript file....
Read more >
source-map-explorer: Versions - Openbase
#143 Broken bundle selection on Windows environments; #133 sourceMappingURL comment included in unmapped size. Add sourceMappingURL as a separate virtual ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found