Find out if a image, css, js file is used or not?

If you really want to strip everything back to the essentials you can use purgecss.

You can find more about it here: