How to get source code from compiled file of vuejs?

≯℡__Kan透↙ 提交于 2021-01-29 18:28:16

问题


I lost my vuejs source code due to of laptop crash. I have files which are compiled by vuejs. Is it possible to get source code from compiled file (files genereated by npm run build in vuecli 2).

I googled it but nothing found. Is there any tool to do so?


回答1:


I found two links for you,

First solution is to use babel (quite difficult) : https://forum.vuejs.org/t/any-method-or-workaround-to-decompile-dynamically-compiled-components/16334/3

Second solution (the best approach), if your compiled files are not in production mode you can check them with vue devtool : https://forum.vuejs.org/t/any-method-or-workaround-to-decompile-dynamically-compiled-components/16334/3

Hope this will help !




回答2:


Normally, npm run build will build the file in production mode.

Vue Devtools will not detect Vue, but inspecting them is not possible since it is already compiled in production mode.

Yes. It's possible to extract "source code", but it will be compiled.
No. It's not possible to get the whole project in its structure back from the compiled file.

tl;dr: No, in your case.



来源:https://stackoverflow.com/questions/55137601/how-to-get-source-code-from-compiled-file-of-vuejs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!