Using renderToString in node
I have a file that looks roughly like this:
How can I run this in node? What configuration, etc., would I need?
4 Replies
not sure if you need anything special to just run it in node
I'm using
renderToString
to test components in "SSR" and it "just works"
but I guess that's in vitest, so it has something configured
like the babel pluginYeah, maybe what I'm missing is the babel plugin
no idea how to add it to node, but the only setting it needs to work there would be
{ generate: "ssr" }
I thinkThere isn't really a practical way to do this. There is
@babel/node
, but I need it to treat everything as ESM modules, which it won't for some reason
Problem seems to be that I don't have type: module set, but unfortunately I don't think I can set it...