From 45654ace01ce18a4dddce5fb584d620e0fea5ac4 Mon Sep 17 00:00:00 2001 From: kouts Date: Sat, 2 Nov 2024 13:15:31 +0200 Subject: [PATCH] fix: improved purgecss config to include new Vue 3 classes --- postcss.config.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/postcss.config.js b/postcss.config.js index 2050fd8..6879d01 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -9,19 +9,28 @@ export default { tailwindcss, autoprefixer, IN_PRODUCTION && + // Reference https://github.com/Developmint/nuxt-purgecss/blob/main/src/config.ts postcssPurgecss({ content: ['./**/*.html', './src/**/*.vue'], defaultExtractor(content) { - const contentWithoutStyleBlocks = content.replace(//gi, '') + const contentWithoutStyleBlocks = content.replace(//gi, '') // Remove inline vue styles - return contentWithoutStyleBlocks.match(/[A-Za-z0-9-_/:]*[A-Za-z0-9-_/]+/g) || [] + return contentWithoutStyleBlocks.match(/[\w-.:/]+(?