S
SolidJS2w ago
oke

Help understanding the `solid` export condition, and how SolidStart uses it

Hi everyone. I am trying to build a Solidjs library and I keep seeing that a solid condition export is needed for libraries to work with SSR and SolidStart. I hope to get some help understanding what this it, why is it needed for SSR, and what is its relation with the generate: 'ssr' option of the babel preset
1 Reply
lxsmnsyc
lxsmnsyc2w ago
basically the solid condition is reserved for Solid bundlers (e.g. vite-plugin-solid), the purpose is to defer the JSX compilation to the end consumer instead of compiling it on your own (so that you don't have to worry about whether to ship server/client bundles) The benefit of doing is not only just about the server/client worries, but also to keep up to date with the compiler changes (a common occurence)

Did you find this page helpful?