I have been attempting to integrate uncss into my gulp workflow.
In order to exclude certain classes, such as those added through javascript, I am specifying these classes with "ignore" (specifically, I am trying to remove the css from the jquery plugin magnific-popup).
My workflow follows this structure and utilizes regex to target all magnific-popup css:
gulp.task("uncsstask", () => {
gulp.src('original-mfp.css')
.pipe(uncss({
html:
[
'page.html',
],
ignore: [
/\.mfp-*.*/g,
]
}))
.pipe(gulp.dest('new'));
});
What is occurring is that the class
.mfp-container
is being included in the new css file, while the class
.mfp-content
is not.
I have verified the accuracy of the regex statement using multiple regex validators.