javascript-obfuscator / webpack-obfuscator

javascript-obfuscator plugin for Webpack
https://github.com/javascript-obfuscator/javascript-obfuscator
BSD 2-Clause "Simplified" License
853 stars 84 forks source link

Fix sourcemap sourcesContent not aligned to sources #163

Open linl33 opened 1 year ago

linl33 commented 1 year ago

The sources array of merged source maps is not always in the same order as the original sources array. By using the original source map's sourcesContent together with the merged source map's sources, the 2 array might not be aligned, which produces a malformed source map.

I believe sourcesContent gets copied from input to the merged source map because the multi-stage-sourcemap library at one point did not produce sourcesContent. But multi-stage-sourcemap has added support for sourcesContent since version 0.3.0 (this project requires ^0.3.1).

bas-coolgames commented 9 months ago

I can confirm that this pull request fixes the main issue I've been having with this package. I can live with working from the fork, but it'd be nicer if this was also fixed in the main version on the npm registry.