(aws-cdk-lib/aws-lambda-nodejs BundlingOptions): `platform` property should default to `node` when not specified
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the bug
The `platform` property in [BundlingOptions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_nodejs.BundlingOptions.html#platform) interface has wrong information.

According to [esbuild API docs](https://esbuild.github.io/api/#platform), the default value is `browser` when no platform is specified. For this reason, we should change the default value to `node` for the `BundlingOptions` of the `NodejsFunction` resource.
### Expected Behavior
see above
### Current Behavior
see above
### Reproduction Steps
see above
### Possible Solution
_No response_
### Additional Information/Context
_No response_
### CDK CLI Version
2.130.0
### Framework Version
_No response_
### Node.js Version
20.10.0
### OS
Ubuntu 22.04.3 LTS
### Language
TypeScript
### Language Version
_No response_
### Other information
_No response_
Contributor guide
Research direction
Start with the BundlingOptions interface and the NodejsFunction resource, then compare the documented platform behavior with the esbuild API documentation linked in the issue. Update the stated default to node and verify that the BundlingOptions documentation reflects the corrected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, node.js, typescript
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100