admin管理员组文章数量:1208155
I'm experimenting with Vercel and want to run a TypeScript ExpressJS service there. There are plenty of turorials and I have something running. However, I am not happy with the way it's configured:
{
"version": 2,
"outputDirectory": "dist",
"builds": [
{
"src": "dist/index.js",
"use": "@vercel/node",
"config": { "includeFiles": ["dist/**"] }
}
],
"routes": [
{
"src": "/(.*)",
"dest": "dist/index.js"
}
]
}
This requires me to checkin the compiled JavaScript to the project's repo, which feels wrong as it's all generated code. If I switch to Vercel building the JavaScript on deployment, which is ideally what I want:
{
"version": 2,
"outputDirectory": "dist",
"buildCommand": "npm run build",
"routes": [
{
"src": "/(.*)",
"dest": "dist/index.js"
}
]
}
then Vercel returns the JavaScript in the index.js file rather than executingstrong text it. I assumed there must be a way to add:
"use": "@vercel/node",
to the build configuration, but if there is I can't find it or work out.
Is there a way to achieve what I want or am I stuck with checking-in generated JavaScript?
本文标签: javascriptCan I build AND run a TypeScript ExpressJS service in VercelStack Overflow
版权声明:本文标题:javascript - Can I build AND run a TypeScript ExpressJS service in Vercel - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738742430a2109927.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论