-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Generic Build Proposal #858
Comments
I will switch from SAM to Serverless if this is not returned to the backlog |
@whiteshadoww as you wish! Although Serverless is also a fine tool and if its features fit your needs better, you should consider it. It has been quite a while since this issue was created and in the meantime the team added support for using makefiles in |
Thanks for this suggestion! We will consider improving our build options to include the feature you mentioned. |
Hello! Just so commenters are aware we have esbuild support in preview, which might solve some of the original commenter's reported issues. To find out more and leave feedback - #3700 Blog post here - https://aws.amazon.com/blogs/compute/building-typescript-projects-with-aws-sam-cli/ |
Our generic builder is Closing |
|
Putting a quick list of what was discussed in #samdev.
The builder implementation is great and
sam build
is exactly what we need. It seems to be missing the ability to go above and beyond typical build solutions. The builder (for node.js) as it stands expects the function code to build for the exact runtime. The issue is that most people use updated versions of node.js (or typescript) and deploy to older node.js runtimes that Lambda supports, as well as a majority of people need more advanced building. Popular tools like https://github.com/zeit/ncc, https://webpack.js.org/, gulp, browserify, babel, etc, etc, help build stuff that can compile down to AWS Lambda specific versions, perform minification, optimize images, etc, etc. It would be great if anyone who uses sam can also build using the tools they wish. We personally use serverless with functions that utilize webpack (react apps), and typescript (tsc -b).I'm proposing a more generic builder solution for anyone to implement their own build functionality that other Lambda deployment tools have.
Apex Up (https://up.docs.apex.sh/)
Up has an .upignore and up.json file. The up.json file can contain custom build commands:
Serverless
There are tons of build plugins for serverless (typescript, webpack, browserify, etc, etc)
Sam Proposal
It'd be awesome if we can take from what's been around for a while and that people are used to and implement it. Automated builds is awesome, but not flexible. If each lambda function could contain their own build directions, that'd make it more flexible.
template.yaml
OR sam.json & .samignore files contained in the function directory (not preferred)
Example of excluding everything and cherry picking what's needed.. you should be able to do the opposite of this too.
You can go even further and look at
scripts.build
inside of package.json and do this in the NPM builder, but I think keeping it simple would be best.I'm more in favor with keeping everything inside of template.yaml if possible.
The text was updated successfully, but these errors were encountered: