Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
db97fbff
Commit
db97fbff
authored
Feb 15, 2017
by
Giuseppe
Committed by
Tim Neutkens
Feb 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix with-styled-jsx-postcss example (#1147)
parent
f3145ab1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
.babelrc
examples/with-styled-jsx-postcss/.babelrc
+1
-4
README.md
examples/with-styled-jsx-postcss/README.md
+3
-0
babel-preset.js
examples/with-styled-jsx-postcss/babel-preset.js
+10
-0
No files found.
examples/with-styled-jsx-postcss/.babelrc
View file @
db97fbff
{
{
"presets": [
"presets": [
"next/babel"
"./babel-preset"
],
"plugins": [
"styled-jsx-postcss/babel"
]
]
}
}
examples/with-styled-jsx-postcss/README.md
View file @
db97fbff
...
@@ -3,6 +3,9 @@
...
@@ -3,6 +3,9 @@
This example features how you use PostCSS with styled-jsx via
[
styled-jsx-postcss
](
https://github.com/giuseppeg/styled-jsx-postcss
)
This example features how you use PostCSS with styled-jsx via
[
styled-jsx-postcss
](
https://github.com/giuseppeg/styled-jsx-postcss
)
N.B. In order to integrate
`styled-jsx-postcss`
with Next.js you need to patch Next.js'
babel preset. See
[
babel-preset.js
](
./babel-preset.js
)
and
[
.babelrc
](
./.babelrc
)
.
## How to use
## How to use
Download the example
[
or clone the repo
](
https://github.com/zeit/next.js
)
:
Download the example
[
or clone the repo
](
https://github.com/zeit/next.js
)
:
...
...
examples/with-styled-jsx-postcss/babel-preset.js
0 → 100644
View file @
db97fbff
const
nextBabelPreset
=
require
(
'next/babel'
)
nextBabelPreset
.
plugins
=
nextBabelPreset
.
plugins
.
map
(
plugin
=>
{
if
(
!
Array
.
isArray
(
plugin
)
&&
plugin
.
indexOf
(
'styled-jsx/babel'
)
!==
-
1
)
{
return
require
.
resolve
(
'styled-jsx-postcss/babel'
)
}
return
plugin
})
module
.
exports
=
nextBabelPreset
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment