亚马逊网络服务 - 使用 `Buildfile` 在 AWS Elastic Beanstalk 上构建 TypeScript
我正在尝试在 AWS EB 上构建 Typescript。根据文档(https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html )Buildfile 应该用于构建。但我猜它根本没有运行。
这是用于我的 EB 的镜像:64 位 Amazon Linux 2 v5.4.5 运行 Node.js 14
这里是其余的信息:
server
┣ src
┃ ┗ index.ts
┣ .gitignore
┣ Buildfile
┣ build.sh
┣ mkzip.sh
┣ package-lock.json
┣ package.json
┗ tsconfig.json
这是我的文件结构。
构建文件 make: ./build.sh
build.sh
#!/bin/bash
npm run build
package.json
{
"name": "server",
"version": "10.0.2",
"main": "index.js",
"scripts": {
"clean": "rm -rf dist",
"build": "npm run clean && tsc",
"start": "node dist/index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"apollo-server": "^3.3.0",
"graphql": "^15.6.0",
"typescript": "^4.4.3"
}
}
有什么想法要检查吗?