To do this, you need to detect them first. For this, use Chrome DevTools. Go to Coverage Tab in this tool and perform your transactions line-by-line here. Detecting the unused code process will be automated.
When you use this tool, you have the opportunity to check whether the bundler has some additional features that can be used to remove unused code. In this way, you can complete the process much more advantageously. Some of these functions are as follows:
Test Your Website Performance!
You can quickly analyze your site in a minute