问题描述
我刚刚完成了我的网站,这是我2年前开始的。我一直在尝试新的东西,有时包括添加不同的框架或其他外部JS文件。
I just finished my website, which I started 2 years ago. I was always trying new things, which sometimes included adding different frameworks or other external JS files.
现在我不知道JS的哪些链接文件/行是没用过。有没有可以检测这些文件和代码行的工具?这会节省我很多时间。
Now I don't know which of the linked files/lines of JS are unused. Is there a tool which can detect these files and lines of code? It would save me a lot of time.
推荐答案
答案提供了,其中包含缩小和连接JavaScript代码,可以删除死代码。
This answer offers Google's Closure Compiler which, in the process of minifying and concatenating your JavaScript code, can remove "dead code".
引自:
另请参阅包含有关Google Closure Compiler的更多信息。
Also see this answer which contains more information on Google's Closure Compiler.
这篇关于检测链接&未使用的文件和未使用的JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!