From 4edc82d67d5ddcb14017adb8b7948514a34fa705 Mon Sep 17 00:00:00 2001 From: Leonardo Faria Date: Mon, 2 Nov 2020 21:21:04 -0800 Subject: Update dev postcss config --- assets/css/dev/postcss.config.js | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'assets') diff --git a/assets/css/dev/postcss.config.js b/assets/css/dev/postcss.config.js index 8f547b9..ccbc2b5 100644 --- a/assets/css/dev/postcss.config.js +++ b/assets/css/dev/postcss.config.js @@ -1,11 +1,30 @@ const themeDir = __dirname + '/../../../'; -module.exports = { - plugins: [ - require('postcss-import')({ - path: [themeDir] - }), - require('tailwindcss')(themeDir + 'assets/css/tailwind.config.js'), - require('autoprefixer'), - ] +module.exports = { + plugins: [ + require('postcss-import')({ + path: [themeDir] + }), + require('tailwindcss')(themeDir + 'assets/css/tailwind.config.js'), + // Configuration of purgecss for Tailwindcss + // see https://tailwindcss.com/docs/controlling-file-size/#setting-up-purgecss + require('@fullhuman/postcss-purgecss')({ + // Specify the paths to all of the template files in your project + content: [ + themeDir + 'layouts/**/*.html', + themeDir + 'exampleSite/content/**/*.html', + 'layouts/**/*.html', + 'content/**/*.html', + 'content/**/*.md', + ], + // Include any special characters you're using in this regular expression + defaultExtractor: content => content.match(/[\w-/:]+(?