-
-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add option to define the root folder of a lambda deployment. #540
Conversation
…s is a requirement of the serverless framework.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
@@ -7,7 +7,7 @@ import path from 'node:path'; | |||
import { existsSync, readFileSync } from 'node:fs'; | |||
|
|||
const ssr = !!import.meta.env.WAKU_BUILD_SSR; | |||
const distDir = import.meta.env.WAKU_CONFIG_DIST_DIR!; | |||
const distDir = process.env?.WAKU_BUILD_DIST_DIR ?? ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly sure how it works, but should default be something other than ''
?
const distDir = process.env?.WAKU_BUILD_DIST_DIR ?? import.meta.env.WAKU_CONFIG_DIST_DIR!;
const distDir = process.env?.WAKU_BUILD_DIST_DIR ?? '.';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a fix to handle the problem of the Serverless framework
including the top folder dist
in the deployed ZIP which is the reason for my problems #514 to implement the private folder in the build-adapter code.
Other deployment solution (e.g. AWS CDK) do not add this extra hierarchy and do not need to know the name of the dist
folder.
This is not a perfect solution, but works for now with both deployment options described in the docs. I will have to optimize it in a next step to remove the currently fixed coded dist
folder in deployment configs for the serverless framework and AWS CDK, to solution which can extract the value from WAKU_CONFIG_DIST_DIR
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, if it's expected to be ''
by default, it's fine. As I don't follow every details, I count on you. 😄
This change allows to handle the differences of bundling the deployment ZIP for the serverless framework and the AWS CDK.