I am doing some JavaScript cleanup work on a legacy project, and trying to get rid of redundant JS libraries. I have done all the obvious ones (those that are not references from anywhere at all). But there are a number of JS files that are included in all pages (via tiles).
How can I find out whether they are actually used, short of going through content of each and search for each function in them? Is there a smarter/easier way to do this? It's a java based / Spring project if that helps by the way.
One of the latest updates from the chrome dev tools now includes a JS and CSS coverage tab that allows you to see your unused code.
https://developers.google.com/web/updates/2017/04/devtools-release-notes
1) Open the Command Menu.
2) Start typing Coverage and select Show Coverage.