Skip to content

Instantly share code, notes, and snippets.

@codenamezjames
Created August 1, 2019 18:53
Show Gist options
  • Save codenamezjames/cbc882b89c9e7db8145898efc8183306 to your computer and use it in GitHub Desktop.
Save codenamezjames/cbc882b89c9e7db8145898efc8183306 to your computer and use it in GitHub Desktop.
// 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