Developmint / nuxt-purgecss

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

Want to add README.md how to customize extractors #52

Closed miyanokomiya closed 5 years ago

miyanokomiya commented 5 years ago

The only way to override the extractors for each extensions: ['html', 'vue', 'js'] is a functional syntax. Because those extensions have been set by default and purgecss uses only one extractor for each extentions. https://github.com/FullHuman/purgecss/blob/bc9f3b5b9d670832f0d1cca7bc7facfb253fb60b/lib/purgecss.js#L704-L714

This extractor cannot work.

  extractors: [
    { extractor: MyExtracotor1, extensions: ['vue'] }
  ]

We must write configs as below to make our extractors work.

  extractors: () => [
    { extractor: MyExtracotor1, extensions: ['vue'] }
  ]
manniL commented 5 years ago

Go ahead :+1: