Developmint / nuxt-purgecss

Drop superfluous CSS! A neat PurgeCSS wrapper for Nuxt.js
MIT License
478 stars 18 forks source link

[BUG] Compatibility with purgecss v2 #73

Closed LuXDAmore closed 4 years ago

LuXDAmore commented 4 years ago

I've update to the new version of PurgeCSS (v2.0.3) and there is an issue now during the build:

TypeError: Class constructor extractor cannot be invoked without 'new'

LuXDAmore commented 4 years ago

There is an issue opened on the repo of PurgeCSS

LuXDAmore commented 4 years ago

Fixed for me with:

{
    purgeCSS: {
        extractors: () => [
            {
                extractor: content => ( content || '' ).match(
                    /[A-z0-9-:\\/]+/g
                ),
                extensions: [
                    'html',
                    'vue',
                    'js',
                ],
            },
        ],
    },
}
manniL commented 4 years ago

Upgrading to PurgeCSS 2 should be part of the next major version 👍🏻

simllll commented 4 years ago

Just created a PR including a backwards compatible function check, therefore a non breaking change.