SST
Configure SST and serverless functions to work with @cipherstash/stack
SST
When deploying @cipherstash/stack in serverless functions with SST, you need to exclude the package from esbuild bundling and install it into the Lambda deployment artifact.
Configure nodejs.esbuild.external and nodejs.install in your sst.config.ts:
{
nodejs: {
esbuild: {
external: ["@cipherstash/stack"],
},
install: ["@cipherstash/stack"],
},
}The external option prevents esbuild from bundling the package. The install option ensures it gets installed into the Lambda deployment artifact so it's available at runtime.
See the SST Function documentation for more details.
For other bundler configurations (webpack, esbuild, Next.js) and Linux deployment troubleshooting, see Bundling.