FullHuman/purgecss-webpack-plugin

whitelistPatterns troubles on cascading

laureProthais opened this issue · 0 comments

Hello,

I have some troubles with whitelistPatterns option.

I want to whitelist all selectors containing a specific word slick so here is my configuration :

new PurgeCssPlugin({
      paths: glob.sync([
        path.join(__dirname, "assets/js/**/*.js"),
        path.join(__dirname, "templates/**/*.html.twig")
      ]),
      whitelistPatterns: [/slick/, /icon-/]
})

It works well but I have some selectors exceptions like that one:
.theme-slider.slick-arrow.icon-arrow-left or [class^="icon-"].slick-arrow.theme-slider or [class*=" icon-"].slick-arrow.theme-slider

By adding theme-slider is solved my problem but I want to understand the trouble to avoid to adding a maximum of selectors.

I'm working with webpack@3.12.0 and symfony/webpack-encore@0.20.0.

Tks !!