Shared deps are necessary and having them go out of sync is an error prone condition. Recommendation: out-of-date dependencies is a failing test!
Module dependencies in an
.arc project are defined in two places:
- The root project
- The Lambda function code in
Every time you run
npx deploy node modules are automatically installed into the Lambdas before deployment using the Lambda
package.json. If you wish to add more node modules you need to manually run
npm i modulename from within the Lambda directory.
Starting from a fresh checkout you won't have any dependencies installed.
npm i will install root node modules.
npx hydrate runs
npm i within all the Lambda functions.
npm i npx hydrate
Run the project locally with
npx hydrate update will update node modules in the Lambda functions. If you need to upgrade breaking changes you will need to manually
cd into the Lambda directory and run
npm rm modulename && npm i modulename to get the latest version.
- Check in
- Also make sure every Lambda has a
- Ensure your deps are synchronized within an
More complex projects will have unique build requirements which you can compose as you see fit. We recommend a
./scripts folder for those particulars.