create-react-library icon indicating copy to clipboard operation
create-react-library copied to clipboard

How do I set up postcss?

Open atomeon opened this issue 5 years ago • 0 comments

For create-react-app I used craco to setup postcss. Any ideas how can i implement my postcss styles around here?

I had craco.config.js

const postcssFlexbugsFixes = require('postcss-flexbugs-fixes');
const autoprefixer = require('autoprefixer');
const postcssPresetEnv = require('postcss-preset-env');
const postcssCustomMedia = require('postcss-custom-media');
const mq = require('mylib/mq/mq.json');

module.exports = {
    style: {
        postcss: {
            plugins: [
                postcssFlexbugsFixes,
                postcssPresetEnv({ stage: 1 }),
                autoprefixer({
                    flexbox: 'no-2009', // I'd opt in for this - safari 9 & IE 10.
                }),
                postcssCustomMedia({
                    importFrom: [
                        {
                            customMedia: mq,
                        },
                    ],
                }),
            ],
        },
    },
};

atomeon avatar Jun 18 '20 06:06 atomeon