You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,6 +171,39 @@ export default {
171
171
}
172
172
```
173
173
174
+
### Use custom extractors
175
+
Only one extractor can be applied to each file extention.
176
+
If you want to apply a custom extractor to the extensions that the default extractor already covers, you have to override the default extractor. This is only possible with the functional notation.
177
+
178
+
```js
179
+
//nuxt.config.js
180
+
exportdefault {
181
+
modules: [
182
+
'nuxt-purgecss',
183
+
],
184
+
185
+
purgeCSS: {
186
+
extractors: () => [
187
+
{
188
+
extractor:class {
189
+
staticextract(content) {
190
+
returncontent.match(/[A-z0-9-:\\/]+/g)
191
+
}
192
+
},
193
+
extensions: ['html', 'vue', 'js']
194
+
},
195
+
{
196
+
extractor:class {
197
+
staticextract(content) {
198
+
returncontent.match(/[A-z0-9-\\/]+/g)
199
+
}
200
+
},
201
+
extensions: ['vue'] // This will not work, because the above extractor is applied to 'vue' already.
0 commit comments