devowlio / wp-react-starter

🚀WordPress Plugin Boilerplate using modern web techs like TypeScript, SASS, and so on... on top of a local development environment with Docker and predefined GitLab CI for continous integration and deployment!
https://devowl.io/wp-react-starter/
Other
391 stars 50 forks source link

Use Clean-CSS instead of cssnano #3

Closed matzeeable closed 6 years ago

matzeeable commented 6 years ago

Use https://github.com/leodido/postcss-clean npm install --save-dev postcss-clean

postcss.config.js

module.exports = ({ file, options, env }) => ({
    plugins: [
        require('autoprefixer')
    ].concat(env === 'production' || env === 'umd' ? [require('postcss-clean')(options.clean)] : [])
});

webpack.config.js

loader: 'postcss-loader',
options: {
    config: {
        ctx: {
            clean: {}
        }
    }
}