问题
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