Hi, I noticed a strange thing. Don't know if it's known.
My config
gulp.task('purifycss', function () {
return gulp.src('src/bundle/css/**/*.css')
.pipe(purify(['src/bundle/js/**/*.js', 'src/**/*.html']))
.pipe(gulp.dest('src/bundle/css'))
});
This config works perfectly fine but strange results for following things.
Case: If I've 2 selectors in css file '.js-newClass' and '.newClass1' where only '.js-newClass' is being added through js and '.newClass1' is nowhere used. So purifycss still keeps '.newClass1' because of string matching 'newClass' in both selectors and '.js-newClass' is being kept because it's been used in js. Observations:
If I would remove '.js-newClass' from js then purifycss will remove both selectors from final css.
If I would rename '.js-newClass' to '.js-newClas' or '.js-newClassa' then also it will remove '.newClass1' selector from the final css.
If I would rename '.js-newClass' to '.js-newClass-hello' then also it keeps 'newClass1'
If I would rename '.newClass1' to '.newClass' then also it still keep '.newClass' in the final css because 'newClass matches with '.js-newClass' substring
If I would rename '.newClass1' to '.newClassa' then it removes it from final css because '.newClassa' is differently matches to '.js-newClass' than how '.newClass1' is matched to '.js-newClass'. So, putting number doesn't matter.
Please, let me know, whether it's know or can it be fixed with an update?
Hi, I noticed a strange thing. Don't know if it's known.
My config
This config works perfectly fine but strange results for following things.
Case: If I've 2 selectors in css file '.js-newClass' and '.newClass1' where only '.js-newClass' is being added through js and '.newClass1' is nowhere used. So purifycss still keeps '.newClass1' because of string matching 'newClass' in both selectors and '.js-newClass' is being kept because it's been used in js.
Observations:
Please, let me know, whether it's know or can it be fixed with an update?
Thanks