Server bundles embed source maps already saved as .map files
Author: tropicalsealCreated Sep 12, 2026Updated Sep 14, 2026
Labelsmodern-build-stack
Expected behavior: Reference the external .map file instead of embedding a duplicate.
Commit 948d9628f8c9 added embedding in October 2017. The stated reason was to avoid loading map files from disk on Windows.
Chromium fixed Windows path handling in January 2018. Node closed the linked issue as fixed in February 2019.
There is no need to embed source maps anymore. For example of the impact in https://github.com/wekan/wekan:
app.js: 134.05 MiB
Embedded map URL: 88.55 MiB
The embedded map accounts for 66% of the file.
Reproduction
Meteor writes a .map file, then embeds the same map as base64 in the JavaScript, including production builds.
loadItem.sourceMap = await builder.writeToGeneratedFilename(
item.targetPath + ".map",
{ data: sourceMapBuffer }
);
const sourceMappingURL =
"data:application/json;charset=utf8;base64," +
sourceMapBuffer.toString("base64");
sourceBuffer = addSourceMappingURL(
item.source,
sourceMappingURL,
item.targetPath,
);
Source: meteor/meteor