uncss: Uncss causes infinite loop

I’m running uncss against a fairly large CSS file (Contains all google fonts). To see the infinite loop checkout this repository:

git checkout https://github.com/superflycss/utilities-fonts
cd utilities-fonts
npm run deploy

This will end up running the superflycss deploy task. If uncss is removed the task completes. To remove do

atom node_modules/@superflycss/task-deploy/src/main/js/index.js

Change the uncss_test_processors postcss plugins array to this:

var uncss_test_processors = [pc_import, pc_each, pc_for, pc_custom_properties, pc_apply, pc_calc, pc_color_function, pc_sass_color_functions, pc_custom_media, pc_font_magician, autoprefixer, pc_reporter({
  clearMessages: true
})];

Then run the task again:

npm run deploy

It now completes in about 30 seconds.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 20 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Indeed. I’ll experiment more with this later to narrow down the exact cause. This sample has a lot of moving pieces like font rendering, etc. It would be interesting to see what would happen if I generated 100K css lines of border colors and ran it against a simple html file with one element that is using a single border style and color.