aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.83k stars 822 forks source link

allow building Lambda Layers with npm scripts `amplify:<layer-name>` #13405

Open lucajung opened 1 year ago

lucajung commented 1 year ago

Amplify CLI Version

12.8.2

Question

I just read about the ability of the amplify cli to call all scripts in the root directory that start with amplify: on amplify push -y. But it doesn't seem to work. Is this still a feature?

josefaidt commented 1 year ago

Hey @lucajung :wave: thanks for raising this! This feature is specific to Functions, where you can name an npm script as amplify:<function-name> and the CLI will invoke this after installing dependencies for the Function. https://docs.amplify.aws/cli/function/build-options/

What is the use case you're looking to address?

lucajung commented 1 year ago

Hi!

The use case described in this article is actually exactly what I am trying to achieve. However, I am trying to call the function in a layer project and not in a pure function project. Does this matter?

josefaidt commented 1 year ago

Hey @lucajung I do not believe this will work with Lambda Layers, unfortunately, however I can mark this as a feature request to introduce this behavior.

lucajung commented 1 year ago

Thanks!