Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// https://github.com/michael-ciniawsky/postcss-load-config
const purgecss = require('@fullhuman/postcss-purgecss')
const conf = require('./quasar.conf')()
const ie = conf.supportIE ? ['./node_modules/quasar/src/ie-compat/*.js'] : []
const plugins = conf.framework.plugins.map(plug => {
return `./node_modules/quasar/src/plugins/${plug}.js`
})
const directives = conf.framework.directives.map(dir => {
return `./node_modules/quasar/src/directives/${dir}.js`
})
const components = conf.framework.components.map(com => {
return `./node_modules/quasar/src/components/${com.split(/(?=[A-Z])/).slice(1).join('-').toLowerCase()}/*.js`
})
module.exports = ({env, options}) => {
return {
...options,
plugins:[
require('autoprefixer'),
env === 'production' || true ? purgecss({
content: [
'./src/**/*.vue',
...ie,
...plugins,
...directives,
...components
],
whitelist: ['html', 'body'],
fontFace: true
}): false
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment