Socket
Socket
Sign inDemoInstall

react-app-rewire-postcss

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-app-rewire-postcss

Configure PostCSS in Create React App without ejecting


Version published
Weekly downloads
4.4K
increased by12.09%
Maintainers
1
Weekly downloads
 
Created
Source

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!

Keywords

FAQs

Package last updated on 13 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc