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

sourceMap not working when used as a loader? #111

Open Andy9822 opened 3 years ago

Andy9822 commented 3 years ago

Hi,

I've been using webpack-obfuscator for a couple of months and this week decided to enable sourceMap due to unreadable stacktrace being generated at our Sentry. So, it would be nice to have this sourceMap generation I thought... But it's not working.

I've been reading the issues and it seems you didn't have support for it a few months ago, it was also mentioned in the README.MD, but now it's supposed to be working. I upgraded the package version to its latest but couldn't make it work.

I'm using webpack-obfuscator as a loader, exactly as it is described in the README.MD and it works perfectly for everything else but when enabled sourceMap it just doesnt't generate anything, even with or without custom sourceMapFileName property.

desk467 commented 3 years ago

I had done a test with javascript-obfuscator a while ago and I realized that it only generates the sourceMap when it runs via CLI. When executed as a webpack loader or as a webpack plugin, the settings for sourceMap seems to be ignored. Is this the expected behavior ?

sanex3339 commented 3 years ago

The loader does not support source maps. PR welcomed. Btw, the plugin should support source maps after this PR: https://github.com/javascript-obfuscator/webpack-obfuscator/pull/104