-
Notifications
You must be signed in to change notification settings - Fork 62
Description
Feature request description
Looking at the current implementation of sourcemap commands, it seems that the command is trying to match the js with the map file by name.
However it seems not all bundler will respect that, and instead suggest to use the sourceMappingURL comment at the end of each file.
For instance, Nextjs and its default Turbopack bundler seems to suggest that matching file name is not a given, and they won't fix it, as highlighted here.
In this case when building with webpack the output is as follow:
hashedFile.js
hasehdFile.js.map
// at the bottom of hashedFile.js
//# sourceMappingURL=hashedFile.js.mapWhile with Turbopack
hashedFile.js
differentHashed.js.map
// at the bottom of hashedFile.js
//# sourceMappingURL=differentHashed.js.map(hope it make sense)
Solution
The sourcemap upload command respect the //# sourceMappingURL linking in the minified file when uploading sourceMaps.
Additional context
I understand that this is a pure bundler difference, but seeing how popular NextJS is, and its move towards Turbopack as a default with its latest version, is something worth considering it.
Command
sourcemaps