Legacy frontend code. How to deal with it?

Hello, I am developing html and css code for one of the page on web-site. There are ready pages for another pages and these pages have a lot of common elements.
The problem is that current html and css code is very complicated and has a lot uses ~20 javascript libraries and ~20 css style files. It's really hard to understand existing code and all dependencies in this code. Too I suspect there is a lot of garbage in these files.
Could you give your advice how to deal with such code? Are there some strategies/lifehack/plugins to reduce complexity of existing web-pages and to remove unused parts?
I will be thankful for your ideas

Please sign in to leave a comment.