https://github.com/morulus/react-app-rewire-postcss-config
Rewire postCss with react-app-rewire
https://github.com/morulus/react-app-rewire-postcss-config
Last synced: 11 months ago
JSON representation
Rewire postCss with react-app-rewire
- Host: GitHub
- URL: https://github.com/morulus/react-app-rewire-postcss-config
- Owner: morulus
- License: mit
- Created: 2017-11-01T15:10:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-07T00:27:59.000Z (over 8 years ago)
- Last Synced: 2025-06-10T09:41:19.324Z (about 1 year ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
react-app-rewire-postcss-config
==
Transform [PostCss](https://github.com/postcss/postcss) loader in a [react-app-rewired](https://github.com/timarney/react-app-rewired) config
__Access PostCss whole loader__
You just pass a function, which accepts current PostCss loader object. And then you mutate it... No need to return result.
```js
const rewirePostCssLoader = require('react-app-rewire-postcss-config');
return rewirePostCssLoader((postCssLoader) => {
postCssLoader.options.parser = 'sugarss';
});
```
__To transform PostCss plugins__
You pass a function, which accepts current plugins. You do something with current plugins, transforms it and then returns back.
```js
const { rewirePostCssPlugins } = require('react-app-rewire-postcss-config');
const postCssNext = require('postcss-cssnext');
const postCssNested = require('postcss-nested');
export default rewirePostCssPlugins((currentPlugins) => {
return [
postCssNested(),
postCssNext(),
].concat(currentPlugins);
})
```