Typescript and `vercel dev`
Unanswered
Barbary Lion posted this in #help-forum
Barbary LionOP
Using the node-hello-world template (https://github.com/vercel/examples/tree/main/solutions/node-hello-world), I'm finding I can't develop locally without adding "type": "module" to package.json, but if that's included in the push then vercel won't render the serverless functions without error (ERROR ReferenceError: exports is not defined in ES module scope).
So I have to include that for local dev, but remove it for pushes. Can someone enlighten me on how I can sync these two environments up?
I believe vercel is transpiling somehow behind-the-scenes, and I was wondering if it's using something like ts-node in the background? Though I'm not sure how to use ts-node on these serverless functions since there's no index.ts/js or entrypoint.
So I have to include that for local dev, but remove it for pushes. Can someone enlighten me on how I can sync these two environments up?
I believe vercel is transpiling somehow behind-the-scenes, and I was wondering if it's using something like ts-node in the background? Though I'm not sure how to use ts-node on these serverless functions since there's no index.ts/js or entrypoint.