Replies: 1 comment 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
StyleX added official Babel + PostCSS config for their library. The community is trying to add a Vite example, but there is no official support. I'm documenting my progress in this issue:
facebook/stylex#1103
I managed to integrate StyleX it with the official Vite React repo:
https://github.com/hyperknot/bug_repro/tree/main/vite_stylex_react
My problem is that when porting the same snippet to the Vite Solid repo, it doesn't work:
https://github.com/hyperknot/bug_repro/tree/main/vite_stylex_solid
The Vite config is almost exactly the same, one has this:
while the other has this:
So the difference / bug in the Solid config lies inside the plugins.
This is the babelConfig value (it is the same in both):
So I'm trying to debug the Solid plugin, and it has a line:
await babel.transformAsync(source, babelOptions);
Here is what that babelOption's value is when calling this function, console.log-ed at runtime:
The React plugin - which works correctly - uses this options for the same babel.transformAsync line:
https://github.com/vitejs/vite-plugin-react/blob/1583c5d727265faa668ab3d7009736e9fc01ec9c/packages/plugin-react/src/index.ts#L303
Can you have a look at these options, and point it out to me where can the StyleX parsing bug happen in the Solid version? The React version works correctly.
// I also asked this in Babel discussions:
babel/babel#17408
Beta Was this translation helpful? Give feedback.
All reactions