Describe the bug
Recently, I made a project with TailwindCSS 1+, PurgeCSS, and Gulp.
You can find the repository here.
The gulp task:
gulp.task('css', function () {
return gulp.src('tailwind.css')
// ...
.pipe(postcss([
// ...
tailwindcss('tailwind-config.js'),
...when(config.productionMode, require('@fullhuman/postcss-purgecss')({
content: [
path.resolve(__dirname, '/**/*.html')
],
defaultExtractor: content => content.match(/[A-Za-z0–9-_:/]+/g) || []
})),
require('autoprefixer'),
...when(config.productionMode, require('cssnano')()),
// ...
]))
// ...
.pipe(gulp.dest('dist'));
});
When I build the application in productionMode PurgeCSS does not work.
The final output has changed but does not work properly when it's displayed.
To Reproduce
Steps to reproduce the behavior:
npm installnode_modules/.bin/gulp run in "productionMode": trueExpected behavior
I expect to work only!
Screenshots
Without PurgeCSS:

With PurgeCSS:

Desktop (please complete the following information):
I had a similar issue with gulp 4.x and Tailwind 1.2.
I changed the default extractor pattern, as suggested on the Tailwind website here, to:
defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || []
after this change, my css worked again.
Most helpful comment
I had a similar issue with gulp 4.x and Tailwind 1.2.
I changed the default extractor pattern, as suggested on the Tailwind website here, to:
defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || []after this change, my css worked again.