How to know if javascript lib is still used in a website?

大憨熊 提交于 2019-12-23 04:53:18

问题


I'm working on a website which is quite a mess. In the <head> of the website about a zillion javascript libraries are loaded and I think many of them are not used anymore. The problem is that I'm not sure.

In Python (my language of choice) there are always clear namespaces and using a capable Python editor (such as Pycharm) clearly highlights unused imports. I'm looking for something similar in html/javascript.

I can of course start writing a comprehensive set of UI-tests (which I should do anyway), but that is something for a later stage. I first want to clean up the code a bit and speed up loading time.

Does anybody know (a preferably simple way) how I can find out if a library loaded in <head> is still used anywhere on the website?

来源:https://stackoverflow.com/questions/33145094/how-to-know-if-javascript-lib-is-still-used-in-a-website

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