vercel / styled-jsx

Full CSS support for JSX without compromises
http://npmjs.com/styled-jsx
MIT License
7.7k stars 262 forks source link

Is styled-jsx works with parcel v2 #767

Closed lCaveh closed 2 years ago

lCaveh commented 2 years ago

I created a react app with Parcel 2 package builder, and added styled-jsx to it. I also added it to .babelrc plugins as instruction

{
  "plugins": [
    "styled-jsx/babel"
  ]
}

It doesn't raise any error but classNames doesn't transpile to a dynamic name like "jsx-blablabla". It seems that parcel or babel ignore styled-jsx package at all. So want to make sure if it is working with Parcel version 2 or if I need to add any configuration to make it work there.

huozhi commented 2 years ago

Hi @lCaveh do you have a minial reproduction for this that can help us investigate it? 🙏

lCaveh commented 2 years ago

Hi @huozhi, I pushed a simple react project using parcel2 and styled-jsx here: https://github.com/lCaveh/parcel2 It just shows a text and style it. If you check the dev box, it will not generate jsx-blabla class name.

lCaveh commented 2 years ago

It seems that parcel 2 ignore babel configuration as it is follow its default built in babel configs. I don't know if there is a way to let styled-jsx work without adding it to babel plugins or if we can override parcel built in babel configs.

huozhi commented 2 years ago

Yeah the plugin seems not to be executed. I cross submit it on parcel side

mischnic commented 2 years ago

Why did you add that .parcelrc? Babel doesn't run because you removed the Parcel Babel plugin: https://github.com/parcel-bundler/parcel/issues/7474#issuecomment-998773396

huozhi commented 2 years ago

I tried to remove the .parcelrc it still seems not working?

huozhi commented 2 years ago

Close since it's the issue with usage related to specific bundler