Skip to content

Commit fac3a09

Browse files
leecadeJoseph A. Szczesniak
authored andcommitted
Support custom config file path, close: #23 (#24)
* Support custom config file path, close: /issues/23 * format example config as json * v2.0.1
1 parent 7df45db commit fac3a09

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,26 @@ babel configuration:
2525
}
2626
```
2727

28+
With config:
29+
30+
```json
31+
{
32+
"plugins": [
33+
["styled-jsx/babel", {
34+
"plugins": [
35+
[
36+
"styled-jsx-plugin-postcss",
37+
{
38+
"path":
39+
"[PATH_PREFIX]/postcss.config.js"
40+
}
41+
]
42+
]
43+
}]
44+
]
45+
}
46+
```
47+
2848
### Example with CRA
2949

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

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = (css, settings) => {
1414
wait = false
1515
}
1616

17-
processor(cssWithPlaceholders)
17+
processor(cssWithPlaceholders, settings)
1818
.then(resolved)
1919
.catch(resolved)
2020
loopWhile(() => wait)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "styled-jsx-plugin-postcss",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Plugin to add PostCSS support to styled-jsx",
55
"main": "index.js",
66
"scripts": {

processor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function processor(src, options) {
99

1010
let loaderPromise
1111
if (!plugins) {
12-
loaderPromise = loader(options.env || process.env, null, { argv: false })
12+
loaderPromise = loader(options.env || process.env, options.path, { argv: false })
1313
.then(pluginsInfo => {
1414
plugins = pluginsInfo.plugins || []
1515
})

0 commit comments

Comments
 (0)