I'm developing a website and I want to remove unused stylesheet links and JavaScript scripts from my HTML pages to make the page load faster.
I'm using PhpStorm and it would be really grateful if someone could help me with this.
I'm developing a website and I want to remove unused stylesheet links and JavaScript scripts from my HTML pages to make the page load faster.
I'm using PhpStorm and it would be really grateful if someone could help me with this.
For css you can use: https://unused-css.com/ For js you can use: https://marketplace.visualstudio.com/items?itemName=RobertHoffmann.FindUnusedFiles
unused-css is using a headless browser to generate its report. If your site is using JavaScript to generate content based on user actions, it will not work correctly.
Tools like https://www.bleachcss.com/ or https://github.com/purifycss/purifycss are much better to handle this case.