Created
August 1, 2019 18:53
-
-
Save codenamezjames/cbc882b89c9e7db8145898efc8183306 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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