stephenmathieson/node-obfuscator

Support source maps

bminer opened this issue · 3 comments

It would be REALLY cool if node-obfuscator could generate source maps that link the obfuscated JavaScript code back to the appropriate source file/line/column, etc. for debugging purposes.

From what I understand, you could pass a source map option to node-obfuscator to eventually be passed along to uglifyjs; however, this source map would be for the concatenated JavaScript, not for the original source. With a little bit of work, it might be possible to map the uglifyjs source map back to the original source code.

Thoughts on this?

Hmm.. may be able to add it in at obfuscator.register, as it's aware of both the filename and its contents. I like the idea, as it would make locating bugs much, much easier.

+1 this would be super helpful