[英]How do i avoid SAM build installing devDependencies
my current folder structure is as attached file.我当前的文件夹结构如附件所示。 it's a nodejs application and we use SAM to deploy in AWS.
它是一个 nodejs 应用程序,我们使用 SAM 在 AWS 中部署。 each folder is a separate lambda function and it has devDependencies in package.json which really does not need to be bundled during SAM build.
每个文件夹都是一个单独的 lambda function 并且它在 package.json 中有 devDependencies,在 SAM 构建期间确实不需要捆绑。 but as I understand the default behaviour of "sam build" is to install devDependencies as well.
但据我了解,“sam build”的默认行为也是安装 devDependencies。 In my case this devDependcies are in the private repository so i need.npmrc file in each folder to make "sam build" command work.
在我的例子中,这个 devDependcies 在私有存储库中,所以我需要每个文件夹中的 .npmrc 文件来使“sam build”命令工作。 but i really dont need these devDependencies as we use layers and all dependencies are stored in layers in my serverless application.
但我真的不需要这些 devDependencies,因为我们使用层,所有依赖项都存储在我的无服务器应用程序的层中。 How do i make aws build ignore my dev dependencies?
我如何让 aws build 忽略我的开发依赖? [1]: https://i.stack.imgur.com/91qd2.png
[1]: https://i.stack.imgur.com/91qd2.png
What version of SAM are you using?您使用的是什么版本的 SAM? It used to be a bug with
esbuild
in older version of SAM, but should be fixed as of 1.56.0
: https://github.com/aws/aws-sam-cli/issues/4040它曾经是旧版本 SAM 中
esbuild
的一个错误,但应该从1.56.0
: https://github.com/aws/aws-sam-cli/issues/4040
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.