Repository navigation
Replies: 1 comment
|
The difference comes down to which files Vite routes through Babel. In Your SolutionYou need to ensure Two ways to solve this in Vite: 1. Use
|
|
The difference comes down to which files Vite routes through Babel. In Your SolutionYou need to ensure Two ways to solve this in Vite: 1. Use
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm working on making an proper implementation of StyleX with Solid + Vite.
Officially StyleX doesn't have a Vite example, but they have an official Babel plugin and PostCSS plugin.
I was able to integrate those for the React Vite starter, it works correctly (if they accept it, my example would be an official Vite StyleX example one day):
https://github.com/hyperknot/bug_repro/tree/main/vite_stylex_react
Now, I'm trying to do the same for SolidJS, but the same syntax doesn't work.
I mean I have this in React:
And in Solid:
Yet somehow the Solid one behaves totally different, it's not processing the files with babel. I've spent many hours on this issue, but I think I'm stuck, I don't know the internals of vite-plugin-solid. How is it different from vite-plugin-react?
Here is the full vite config:
https://github.com/hyperknot/bug_repro/blob/main/vite_stylex_solid/app/vite.config.ts
How can I implement this babel transformation step with Solid?
If you'd like to have a look at it, please look at my example here:
https://github.com/hyperknot/bug_repro/tree/main/vite_stylex_solid/app
When you run
pnpm dev, it'll sayThis is the step which is somehow skipped in Solid plugin, but is working fine in the React plugin.
All reactions