Webpack & the Lambda bundle
The Lambda artifact is a single JS bundle produced by Webpack (build/configs/webpack.js). There is no node_modules on the Lambda host — everything needed at runtime must be included in the bundle or available via AWS SDK (v3 clients are dependencies and get bundled).
TypeScript
ts-loader(and related plugins) transpilesrc/**/*.tsto CommonJS compatible with Node 22.x runtime.- Strict mode is off in
tsconfig.json, but new code should still be typed clearly.
Path alias: @app
@app→./src— use in imports:import x from '@app/frameworks/jsonapi'.
doT templates
.dotfiles compile to functions at build time viadot-loader— template endpoints do not read.dotfrom disk at runtime in Lambda.
Environments
yarn build,yarn build:dev,yarn build:stageselect webpack mode and env injection appropriate to the target deploy (see scripts inpackage.json).:debugvariants produce unminified bundles for local profiling.
Output
- Bundles land under
build/dist/(gitignored onmaster; follow your branch’s conventions). - CI uploads the built artifact to Lambda per Terraform pipeline.
Common issues
- Forgot to import a dependency used only dynamically — Webpack may tree-shake it away; fix with explicit imports or webpack config exceptions (rare).
- Binary / non-JS assets — ensure
assetloaders orcopypatterns if you add new file types.