purgecss
purgecss copied to clipboard
`@fullhuman/postcss-purgecss` not using config file
Updating @fullhuman/postcss-purgecss to v2.x causes the plugin not to use purgecss.config.jsanymore for some reason.
You can find a live example of this issue in this automated PR: https://github.com/hacknug/tailwindcss-parcel-boilerplate/pull/82
This used to work but now doesn't:
module.exports = {
plugins: {
'postcss-fontpath': { checkFiles: true, ie8Fix: true },
'tailwindcss': 'tailwind.config.js',
'@fullhuman/postcss-purgecss': process.env.NODE_ENV === 'production',
'autoprefixer': {},
},
}
This works fine now but ideally importing the config file and passing it shouldn't be required:
const purgeCssConfig = require('./purgecss.config')
module.exports = {
plugins: {
'postcss-fontpath': { checkFiles: true, ie8Fix: true },
'tailwindcss': 'tailwind.config.js',
'@fullhuman/postcss-purgecss': process.env.NODE_ENV === 'production' && purgeCssConfig,
'autoprefixer': {},
},
}