Hello! The following question: There is a site with many internal pages, there is a style file common to the whole site, in which many irrelevant lines have accumulated over the lifetime. I want to get rid of garbage and divide styles for sections of the site into separate files. For this task I use gulp with the gulp-uncss plugin and I want to optimize actions.

It is necessary to set in gulpfile.js a parameter that will determine the pages, among which uncss will choose the styles used

Now the task looks like this:

gulp.task('uncss', function () { return gulp.src('style.css') .pipe(uncss({ html: ['http://mysite.com/', 'http://mysite.com/**', 'http://mysite.com/**/**', 'http://mysite.com/**/**/**/'] })) .pipe(gulp.dest('css')); }); 

but recursively with all the pages does not pass

Tell me, please, how to write a task correctly to avoid compulsory prescription of all url. I want to achieve recursion when checking the site

  • maybe so http://mysite.com/**/*.html still you seem to have an error in .pipe(gulp.dest('css')); }); .pipe(gulp.dest('css')); }); rather, it should be .pipe(gulp.dest('css')); - stackanon
  • @stackanon the developer’s response to the github github.com/giakki/uncss/issues/264 still doesn’t have this functionality - wannaBpro

0