Draw.io : How can I debug unminified js code?

2019-07-25 04:26发布

问题:

I downloaded draw.io source files from the github repository and tried to make some minor changes to the import function, but all the sources are minified (especially app.min.js). So my question is this: is there any way to debug the code with the unminified sources? Also I tried to pass inside the query string the param dev=1, but it gives some errors and doesn't manage to load.

I already saw the post Draw.io — Is there non-minified source? but I don't know how to build draw.io.

回答1:

If you know the function that you need to edit you can use https://unminify.com to reverse the spacing minification but the variable and function names will still be simplified making it difficult (but not impossible) to edit.



回答2:

I've found, in my opinon, a strange solution. I took build.xml file and replaced all the <jscomp> instructions with <concat> so the result file isn't a minification but just a merge of all source files.

This method works just fine and it solves my problem but i don't know if there is a simpler and more right method.