purgecss-webpack-plugin icon indicating copy to clipboard operation
purgecss-webpack-plugin copied to clipboard

whitelistPatterns troubles on cascading

Open laureProthais opened this issue 5 years ago • 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 [email protected] and symfony/[email protected].

Tks !!

laureProthais avatar Jan 09 '20 10:01 laureProthais