added purgecss and cssnano

This commit is contained in:
Danny Coates 2018-10-25 16:49:22 -07:00
parent 211404237a
commit d881755814
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
4 changed files with 2190 additions and 695 deletions

View file

@ -1,10 +1,25 @@
const options = {
plugins: {
'postcss-import': {},
tailwindcss: {},
'postcss-cssnext': {},
'css-mqpacker': {}
class TailwindExtractor {
static extract(content) {
return content.match(/[A-Za-z0-9-_:/]+/g) || [];
}
}
const options = {
plugins: [
require('tailwindcss')('./tailwind.js'),
require('@fullhuman/postcss-purgecss')({
content: ['./app/*.js', './app/ui/*.js'],
extractors: [
{
extractor: TailwindExtractor,
extensions: ['js']
}
]
}),
require('cssnano')({
preset: 'default'
})
]
};
if (process.env.NODE_ENV === 'development') {