Mdb with purgecss


Topic: Mdb with purgecss

digitalmanagerguru pro premium asked 10 months ago

Hi there, I am not able to make use of PurgeCSS with MDB. In another projects without mdb I did not had any trouble.

I am on a project with laravel + vue2 + mdbvue, using laravel-mix 6, laravel-mix-purgecss 6

And on my webpack I've added the purgecss:

.purgeCss({
enabled: true,
extend: {
  defaultExtractor(content) {
    const contentWithoutStyleBlocks = content.replace(/<style[^]+?<\/style>/gi, '')
    return contentWithoutStyleBlocks.match(/[A-Za-z0-9-_/:]*[A-Za-z0-9-_/]+/g) || []
  },
  whitelistPatterns: [/-(leave|enter|appear)(|-(to|from|active))$/, /^(?!(|.*?:)cursor-move).+-move$/, /^router-link(|-exact)-active$/, /data-v-.*/, /show$/, /fa/, /inline-block$/, /text-/, /with-gap/, /ripple/, /scrollbar/, /options-container/, /select-inner-wrapper/, /select-colorful-option/],
},

})

I whitelist some patterns for vue, but still not enough.

Do any of you solve this in the past? I can't beleive no one did this before with mdb.

best regards


Mikołaj Smoleński staff commented 10 months ago

It's the first issue with purgeCSS. We can't help you since it's third-party tool and we haven't tested it before. Best regards


Please insert min. 20 characters.
Status

Open

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Vue
  • MDB Version: 6.7.2
  • Device: Desktop
  • Browser: Chrome
  • OS: Win.10
  • Provided sample code: No
  • Provided link: No