Closed giuseppeg closed 7 years ago
I'm eagerly waiting for this to get fixed as currently we can't update next at all as the project will not build because of this issue. 😄
Let me know if there's anything I can help with.
I thought about this again and I think that probably it doesn't make sense to go down this path just because of Next.js
Even if I were to implement the idea from this issue we'd still need to monkey patch the Next.js preset to run styled-jsx-postcss right after styled-jsx and before optimizations. If we have to do so we might as well replace styled-jsx with styled-jsx-postcss cc @timneutkens @arunoda
Fixed in zeit/next.js/pull/1147 cc @sarukuku ^
@giuseppeg excellent! I'll test it as soon as a release is pushed out on next.
Ah, it's just a config change. Will test later today.
Can we get an update on this please? I'd like to use styled-jsx-postcss with Next.js.
Posterity: https://github.com/giuseppeg/next.js/tree/220b20bdf344ea1028f5ddc16f55304207ea6a74/examples/with-styled-jsx-postcss#example-app-with-styled-jsx-postcss works but seems pretty hacky.
@corysimmons that's good enough for now, soon probably we will add plugins support to styled-jsx which will allow us to add support for postcss, sass etc with just plugins
I like the idea of just adding PostCSS directly to styled-jsx. I mean, vanilla css will work w/ or w/o PostCSS plugins.
Nevermind, I misread this. Yeah, plugins sound good. 👍
Right now styled-jsx-postcss inherits (extends) styled-jsx. In projects like Next.js this results in duplicate output and double work since they also include styled-jsx.
styled-jsx-postcss should export a plugin that doesn't inherits from styled-jsx.
For backwards compatibility we shouldn't change the current structure of the project. The non standalone version could be
index.js
.Both standalone and not standalone vers will share the visitors but the latter will not extend styled-jsx.