2019-03-30 22:55:48 +00:00
|
|
|
const tailwindcss = require("tailwindcss");
|
|
|
|
|
const autoprefixer = require("autoprefixer");
|
|
|
|
|
const purgecss = require("@fullhuman/postcss-purgecss");
|
2019-03-31 18:56:48 +00:00
|
|
|
const postcssImport = require('postcss-import')
|
|
|
|
|
|
|
|
|
|
class TailwindExtractor {
|
|
|
|
|
static extract(content) {
|
|
|
|
|
return content.match(/[A-Za-z0-9-_:\/]+/g) || [];
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-03-30 22:55:48 +00:00
|
|
|
|
|
|
|
|
module.exports = {
|
2019-03-31 18:56:48 +00:00
|
|
|
plugins: [
|
|
|
|
|
postcssImport,
|
|
|
|
|
tailwindcss('./tailwind.config.js'),
|
|
|
|
|
|
2019-04-04 20:29:37 +00:00
|
|
|
// --- !!! purgecss not working !!! ---
|
|
|
|
|
|
|
|
|
|
// purgecss({
|
|
|
|
|
// content: ['./src/**/*.vue'],
|
|
|
|
|
// whitelist: ['html', 'body'],
|
|
|
|
|
// extractors: [
|
|
|
|
|
// {
|
|
|
|
|
// extractor: TailwindExtractor,
|
|
|
|
|
|
|
|
|
|
// extensions: ['html', 'js', 'vue']
|
|
|
|
|
// }
|
|
|
|
|
// ]
|
|
|
|
|
// }),
|
2019-03-31 18:56:48 +00:00
|
|
|
autoprefixer
|
|
|
|
|
]
|
|
|
|
|
}
|