3 ms·
I'll take a look at it, I'm quite obsessed with the perf and I've been giving talks about uncss some time ago. How is this tool/lib different from the other si
by primozcigler 9y ago
I'll take a look at it, I'm quite obsessed with the perf and I've been giving talks about uncss some time ago.
How is this tool/lib different from the other similar tools?
- Ffloriel 9y agoUncss works the following way: The HTML files are loaded by jsdom and JavaScript is executed. All the stylesheets are parsed by PostCSS. document.querySelector filters out selectors that are not found in the HTML files. The remaining rules are converted back to CSS Purgecss will not emulate the dom and execute javascript. Instead, it will read your files, determined the selectors in it and then remove the ones that are not used. A much simpler process that will translate in better performance.
- Ffloriel 9y agoThere is also a section in the readme explaining the differences with the most used libraries: https://github.com/FullHuman/purgecss#differences-with https://github.com/FullHuman/purgecss#differences-with