How to use the customize-cra.addPostcssPlugins function in customize-cra

To help you get started, we’ve selected a few customize-cra examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webzhangle / react- / config-overrides.js View on Github external
const { override, fixBabelImports, addLessLoader,addPostcssPlugins } = require('customize-cra');
module.exports = override(
    fixBabelImports('import', {
        libraryName: 'antd-mobile',
        libraryDirectory: 'es',
        style: true,
    }),
    addLessLoader({
        javascriptEnabled: true,
        modifyVars: { '@btn-primary-bg': '#f00' },
    }),
    addPostcssPlugins([require('postcss-pxtorem')({
        rootValue: 75,
        propList: ['*'],
        // propList: ['*', '!border*', '!font-size*', '!letter-spacing'],
        // propWhiteList: []
        selectorBlackList: [
            'am'
        ]
     }),])
);
github Lectrum / react-workshop / config-overrides.js View on Github external
/* eslint-disable global-require */

const { override, addPostcssPlugins, disableEsLint } = require('customize-cra');

module.exports = override(
    disableEsLint(),
    addPostcssPlugins([
        require('postcss-preset-env')({
            stage:    0,
            features: {
                'custom-media-queries': {
                    importFrom: [
                        {
                            customMedia: {
                                '--phonePortrait':  '(width <= 414px)',
                                '--phoneLandscape':
                                    '(width >= 415px) and (width <= 667px)',
                                '--tabletPortrait':
                                    '(width >= 668px) and (width <= 768px)',
                                '--tabletLandscape':
                                    '(width >= 769px) and (width <= 1024px)',
                                '--desktopS':
                                    '(width >= 1025px) and (width <= 1366px)',