javascript-obfuscator / webpack-obfuscator

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

Solutions to fix sourcemap problem #75

Closed sxwxs closed 4 years ago

sxwxs commented 4 years ago

Hi, I am working on fixing the bug in sourcemap support. The current code only handles .js asserts, but in the emit stage of webpack, changes made to a .js assert object cannot be applied to its corresponding sourcemap file.

I came up with two solutions to fix this problem. The first is to modify the hook stage which may involve more modifications. The second way is to process both the .js asserts and the corresponding .map asserts when require sourcemap, but the problem is we need an additional variable to allow .map asserts to access the obfuscator output.

I've implemented the second solution in my fork(commit) and it's passed the test. I'd like to make a pull request if you think that's okay.

sanex3339 commented 4 years ago

Thank you. PR welcomed!

sanex3339 commented 4 years ago

Merged, thank you!