SAM 运行 没有重建

SAM run without rebuild

我已经开始为 python 使用 AWS SAM。在本地测试我的功能时,我 运行:

sam build --use-container
sam local start-api 
You can now browse to the above endpoints to invoke your functions. You do **not** need to restart/reload SAM CLI while working on your functions, changes will be reflected instantly/automatically.
sam local invoke ...

然后,如果我对代码进行了更改,当我再次调用我的函数时,如果不重新构建代码,它就不会反映出来。我在这里缺少什么技巧吗?这个提示我不是很清楚

您必须直接在 .aws-sam/build 文件夹下更新您的文件,才能在不重建的情况下看到您的更改。

根据 https://github.com/aws/aws-sam-cli/issues/920 & https://github.com/aws/aws-sam-cli/issues/901,您应该有两个 consoles/terminals 打开。一个你 运行 sam local start-api 而不管它的地方。在另一个地方,您重复 运行 sam build(每当您需要更新时)。

如果您觉得这 > 有点烦人,