I am looking for a way to spider a site (or a list of top pages) and determine whether a JS file included on the relevant page is actually needed, or alternatively what pages DO require particular JS files.
Server-side language is PHP. The actual spidering of pages wont be a problem.
I've inherited a very* large site. Up until now the convention was that if a JavaScript file was needed on any sub-page, it would generally be put in the template for every page. No conditions. No minification. No concatenation.
Going forward we will be rolling out require.js but for now something needs to be done on the legacy pages.
- 30k+ files in web directory, Google indexes 350k+ pages for the domain.