提交 db97fbff 编写于 作者: G Giuseppe 提交者: Tim Neutkens

Fix with-styled-jsx-postcss example (#1147)

上级 f3145ab1
{
"presets": [
"next/babel"
],
"plugins": [
"styled-jsx-postcss/babel"
"./babel-preset"
]
}
......@@ -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)
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
Download the example [or clone the repo](https://github.com/zeit/next.js):
......
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册