3 ms·
Chrome has a css coverage tool built in[1]. I suppose it's tricky though, since some html is only visible if there an error (error boxes, etc), or only visible
by tyingq 6y ago
Chrome has a css coverage tool built in[1]. I suppose it's tricky though, since some html is only visible if there an error (error boxes, etc), or only visible in some rare state (logged in as admin, etc).
Screenshot of it looking at unused CSS on HN: https://imgur.com/a/TLywsv5 https://imgur.com/a/TLywsv5
[1] https://developer.chrome.com/docs/devtools/coverage/ https://developer.chrome.com/docs/devtools/coverage/
- Waterluvian 6y agoHuh. I wasn't aware. Thanks. I'll have to see if there's a sensible way to get the results in a format that can be used to progrmatically cull a build output.
- deleted 6y ago[deleted]
- tyingq 6y agoHere's someone doing it with puppeteer: https://blog.fullstacktraining.com/remove-unused-css-javascript-code-from-your-project/ https://blog.fullstacktraining.com/remove-unused-css-javascr...
- mgerullis 6y agoMhh I am sure it could be possible to walk the app with cypress or puppeteer while raising this coverage.