esbuild with only single top level package.json #7290
Unanswered
kiranpradeep
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was following this blog which recommends multiple lambdas using single a top-level package.json with esbuild. But that way, I was not able to run
sam build
without installing esbuild globally. To demonstrate I created an MCVE sam [project] with 2 node.js lambdas sharing a single top-level package.json. I could successfully build this project in the below 2 ways.sam build
npm run build
(package.json build script then runssam build
)But if I just run
![Screenshot 2024-07-26 at 8 57 14 PM](https://private-user-images.githubusercontent.com/1491933/352584932-df98757d-a9f8-495a-b77c-a86552df1a23.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NTA4NTksIm5iZiI6MTczODk1MDU1OSwicGF0aCI6Ii8xNDkxOTMzLzM1MjU4NDkzMi1kZjk4NzU3ZC1hOWY4LTQ5NWEtYjc3Yy1hODY1NTJkZjFhMjMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMTc0OTE5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NzQyMGFhNjA0ZTRjNjBkOTAwYjMyNzdiYzUzYjdjYjU3ZjRiMDYwMzBiZTg5ZmIzZGNjM2EzNjBkMzAxNGZiNyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.f1ZCUQeTRLVfkhvPpYmu8zjQ1m1eF6iJwv_-zS57qlM)
sam build
it gives an error as in the below screenshot. Is there a way to directly runsam build
with esbuild only being an npm dependency?Beta Was this translation helpful? Give feedback.
All reactions