Remarks

Build all Node.js lambdas with the same esbuild configuration.

Example

esbuild-config.yaml for ESM

Bundle: true
Format: esm
OutExtension:
- .js=.mjs
Sourcemap: true
Target: node20
External:
- '@aws-sdk/*'
Define:
- require.resolve=undefined
Banner:
- |
js=import { createRequire } from 'node:module'
import { dirname } from 'node:path'
import { fileURLToPath } from 'node:url'

const require = createRequire(import.meta.url)
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
Platform: node```

```yaml
Metadata:
expand:
plugins:
- '@starterstack/sam-expand/plugins/esbuild-node'
config:
esbuild:
config: ./esbuild-config.yaml

Index

Variables

Functions