Skip to content

Commit c3cf432

Browse files
committed
chore: add how to customize extractors
1 parent 2252ea5 commit c3cf432

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,32 @@ export default {
171171
}
172172
```
173173

174+
### Use custom extractors
175+
Each extention can be applied just one exractor.
176+
If you apply a custom extractor to the extentions applied default extractor already, you have to override the default value.
174177

178+
```js
179+
//nuxt.config.js
180+
export default {
181+
modules: [
182+
'nuxt-purgecss',
183+
],
184+
185+
purgeCSS: {
186+
extractors: () => [
187+
{
188+
extractor: CustomExtractor,
189+
extensions: ['html', 'vue', 'js']
190+
},
191+
{
192+
extractor: CustomVueExtractor, // This cannot work, because above extractor is applied to 'vue' already.
193+
extensions: ['vue']
194+
}
195+
]
196+
}
197+
}
198+
```
199+
175200
## Development
176201

177202
- Clone this repository

0 commit comments

Comments
 (0)