How do I build a single js file for AWS Lambda nodejs runtime

后端 未结 4 1514
不知归路
不知归路 2021-01-31 10:56

We are working on a project/framework that aids in deploying and maintaining code in AWS Lambda. I want to build/bundle all node.js code for a lambda function into one js file b

4条回答
  •  星月不相逢
    2021-01-31 11:42

    This doesn't directly answer your question, but the serverless project might be exactly what someone in this situation needs.

    It allows you to build projects in a normal webpack-style multi-file architecture, then uses a CLI utility to build your project(s) into Lambda-optimized files.

    The CLI also handles function initialization, deployment, and a litany of other functions I've not yet even needed. It will even create/configure your triggers (e.g., s3 object creation or setting up a new REST API thru AWS API service).

    I only have a few Lambda functions, but even maintaining those was a pain until I started using serverless.

    (this is a fawning post, but to be clear I'm not affiliated w/ the project)

提交回复
热议问题