1

I'm having some regex woes.

Using gulp-uncss

I'd like to add some classes to the ignore option.

Any class that starts with .no-

Any class that contains .is-

.no-flexbox {}
.test.is-active {}
.test .is-hidden {}


.pipe(uncss({
    html: ['tmp/public_html/*.html'],
    ignore: ['/(.is-)(\w)*', '(.no-)(\w)*']
}))

This isn't quite right

magicspon
  • 926
  • 2
  • 9
  • 28

1 Answers1

2

Your regexes look incomplete. May be you should do like this

.pipe(uncss({
    html: ['tmp/public_html/*.html'],
    ignore: ['/\.no-\w+/g', '/\.\w+\s?\.is-\w+/g']
}))
Redu
  • 25,060
  • 6
  • 56
  • 76