diff --git a/src/template/page.tsx b/src/template/page.tsx index 393e98c..85f4aaa 100644 --- a/src/template/page.tsx +++ b/src/template/page.tsx @@ -33,6 +33,15 @@ export const generatePage = async ( const res = await purger.purge({ content: [{ extension: "html", raw: `${body}` }], css: [{ raw: css }], + defaultExtractor: (content) => { + // Capture as liberally as possible, including things like `h-(screen-1.5)` + const broadMatches = content.match(/[^<>"'`\s]*[^<>"'`\s:]/g) || []; + + // Capture classes within other delimiters like .block(class="w-1/2") in Pug + const innerMatches = content.match(/[^<>"'`\s.()]*[^<>"'`\s.():]/g) || []; + + return broadMatches.concat(innerMatches); + }, }); const reducedCss = res.map((n) => n.css).reduce((a, b) => `${a}\n${b}`);