1

私はいくつかの正規表現の問題を抱えています。

gulp-uncss の使用

いくつかのクラスを無視オプションに追加したいと思います。

.no- で始まるすべてのクラス

.is- を含むクラス

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


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

これは正しくありません

4

1 に答える 1

2

あなたの正規表現は不完全に見えます。あなたはこのようにすべきかもしれません

.pipe(uncss({
    html: ['tmp/public_html/*.html'],
    ignore: ['/\.no-\w+/g', '/\.\w+\s?\.is-\w+/g']
}))
于 2016-04-01T14:12:29.343 に答える