Skip to content
Permalink
Browse files

Updated readme. Removed files from npm. Updated version.

  • Loading branch information...
NukaPunk committed Oct 11, 2018
1 parent 29cebd1 commit 1534e463bdf255787930a99272252b3d66470fbb
Showing with 38 additions and 5 deletions.
  1. +3 −0 .npmignore
  2. +34 −4 README.md
  3. +1 −1 package.json
@@ -0,0 +1,3 @@
postcss.config.js
test.js
fixture.css
@@ -8,10 +8,12 @@ Use [PostCSS](https://github.com/postcss/postcss) with

## Usage

Install the package first.
_Note that Next.js supports PostCSS out of the box, so you do not need this plug-in is using Next_.

Install this package and also `styled-jsx` first.

```bash
npm install --save styled-jsx-plugin-postcss
npm install --save styled-jsx styled-jsx-plugin-postcss
```

Next, add `styled-jsx-plugin-postcss` to the `styled-jsx`'s `plugins` in your
@@ -25,6 +27,33 @@ babel configuration:
}
```

### Example with CRA

Usage with Create React App requires you to either _eject_ or use [react-app-rewired](https://github.com/timarney/react-app-rewired).

Here is an example using `react-app-rewired`:

```javascript
// config-overrides.js
// this file overrides the CRA webpack.config
const { getBabelLoader } = require('react-app-rewired')
module.exports = function override (config, env) {
const loader = getBabelLoader(config.module.rules)
// Older versions of webpack have `plugins` on `loader.query` instead of `loader.options`.
const options = loader.options || loader.query
options.plugins = [['styled-jsx/babel', {
'plugins': ['styled-jsx-plugin-postcss']
}]].concat(options.plugins || [])
return config
}
```

_Note: Please follow their instructions on how to set up build & test scripts, and make sure you have a correctly formatted `postcss.config.js` as well_.


#### Notes

`styled-jsx-plugin-postcss` uses `styled-jsx`'s plugin system which is supported
@@ -39,8 +68,9 @@ therefore you may want to refer to their docs to learn more about

## Contributions

Although a _Proof Of Concept_ plugin, **PRs and contributions are welcome!** We
aim to drive development of this plugin through community contributions.
**PRs and contributions are welcome!**

We aim to drive development of this plugin through community contributions.

## License

@@ -1,6 +1,6 @@
{
"name": "styled-jsx-plugin-postcss",
"version": "1.0.0",
"version": "1.0.1",
"description": "Plugin to add PostCSS support to styled-jsx",
"main": "index.js",
"scripts": {

0 comments on commit 1534e46

Please sign in to comment.
You can’t perform that action at this time.