purgecss icon indicating copy to clipboard operation
purgecss copied to clipboard

`@fullhuman/postcss-purgecss` not using config file

Open hacknug opened this issue 5 years ago • 0 comments

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': {},
  },
}

hacknug avatar Mar 02 '20 14:03 hacknug