This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

react-app-rewire-postcss

3.0.2 • Public • Published

React App Rewire PostCSS PostCSS Logo

NPM Version Build Status Support Chat

React App Rewire PostCSS lets you configure PostCSS in Create React App v1 and v2 without ejecting.

Usage

Add React App Rewire PostCSS to your Rewired React app:

npm install react-app-rewire-postcss --save-dev

Next, add React App Rewire PostCSS to config-overrides.js in your React app directory:

module.exports = config => {
  require('react-app-rewire-postcss')(config/*, options */);
 
  return config;
};

That’s it! Now you can control PostCSS with all the configuration options from PostCSS Loader:

module.exports = config => {
  require('react-app-rewire-postcss')(config, {
     plugins: loader => [
      require('postcss-preset-env')()
    ]
  });
 
  return config;
};

Alternatively, you can now use postcss.config.js in your React app directory:

module.exports = config => {
  require('react-app-rewire-postcss')(config, true /* any truthy value will do */);
 
  return config;
};
module.exports = {
  plugins: {
    'postcss-preset-env': {
      stage: 0
    }
  }
};

And you can leverage Browserslist by adding a .browserslistrc to your React app directory:

# browsers we support 
 
> 2%
not dead

Happy PostCSS’ing!

Package Sidebar

Install

npm i react-app-rewire-postcss

Weekly Downloads

4,664

Version

3.0.2

License

CC0-1.0

Unpacked Size

17.2 kB

Total Files

8

Last publish

Collaborators

  • tomaash