From 5032ae986748fb5d26dbacc4682c56aac4fc30c6 Mon Sep 17 00:00:00 2001 From: Perry Zhu Date: Mon, 13 Oct 2025 10:54:27 -0700 Subject: [PATCH] fix: pack lambda with node_modules --- .github/workflows/build-lambda.yaml | 5 ++++- .gitignore | 3 ++- scripts/.gitignore | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-lambda.yaml b/.github/workflows/build-lambda.yaml index 3a4399e..22f45ef 100644 --- a/.github/workflows/build-lambda.yaml +++ b/.github/workflows/build-lambda.yaml @@ -31,7 +31,10 @@ jobs: cd scripts yarn install --frozen-lockfile yarn build - cd dist + mkdir -p build + cp -r dist/ build/ + cp -r node_modules/ build/ + cd build zip -r ../../lambda-function.zip . cd ../.. - name: Deploy to S3 diff --git a/.gitignore b/.gitignore index 19ceb5e..bea297c 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,5 @@ dist-ssr *.sln *.sw? -public/data/rolling-images.json \ No newline at end of file +public/data/rolling-images.json +lambda-function.zip \ No newline at end of file diff --git a/scripts/.gitignore b/scripts/.gitignore index 04c01ba..a7db0d7 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore @@ -1,2 +1,3 @@ node_modules/ -dist/ \ No newline at end of file +dist/ +build/ \ No newline at end of file