mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
e7cc2757c3
Co-authored-by: Alexander Lichter <manniL@gmx.net>
32 lines
801 B
JavaScript
32 lines
801 B
JavaScript
const path = require('path')
|
|
const purgecss = require('@fullhuman/postcss-purgecss')
|
|
|
|
const tailwindConfig = path.join(__dirname, 'tailwind.js')
|
|
|
|
class TailwindExtractor {
|
|
static extract (content) {
|
|
return content.match(/[A-Za-z0-9-_:\/]+/g) || [] // eslint-disable-line no-useless-escape
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
plugins: [
|
|
require('tailwindcss')(tailwindConfig),
|
|
require('autoprefixer'),
|
|
purgecss({
|
|
content: [
|
|
path.join(__dirname, './pages/**/*.vue'),
|
|
path.join(__dirname, './layouts/**/*.vue'),
|
|
path.join(__dirname, './components/**/*.vue')
|
|
],
|
|
extractors: [
|
|
{
|
|
extractor: TailwindExtractor,
|
|
extensions: ['vue', 'js', 'html']
|
|
}
|
|
],
|
|
whitelist: ['html', 'body', 'nuxt-progress']
|
|
})
|
|
]
|
|
}
|