Skip to content

Commit 290b654

Browse files
authored
docs(lambda-nodejs): improve esbuild monorepo documentation (#18216)
Closes #18175 - see #18175 (comment) for details. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent a283a48 commit 290b654

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/@aws-cdk/aws-lambda-nodejs/README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ OR
116116
$ yarn add --dev esbuild@0
117117
```
118118

119+
If you're using a monorepo layout, the `esbuild` dependency needs to be installed in the "root" `package.json` file,
120+
not in the workspace. From the reference architecture described [above](#reference-project-architecture), the `esbuild`
121+
dev dependency needs to be in `./package.json`, not `packages/cool-package/package.json` or
122+
`packages/super-package/package.json`.
123+
119124
To force bundling in a Docker container even if `esbuild` is available in your environment,
120125
set `bundling.forceDockerBundling` to `true`. This is useful if your function relies on node
121126
modules that should be installed (`nodeModules` prop, see [below](#install-modules)) in a Lambda
@@ -253,7 +258,7 @@ new lambda.NodejsFunction(this, 'my-handler', {
253258
});
254259
```
255260

256-
Note: A [`tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) is required
261+
Note: A [`tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) is required
257262

258263
## Customizing Docker bundling
259264

0 commit comments

Comments
 (0)