New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@aws-cdk/aws-lambda-nodejs: Esbuild bundling option to disable sourcesContent #17256
Comments
Thanks for submitting this issue, contributions are welcome! I think you know what you need to do if you want to contribute, but I'll share what I've found on a quick look for visibility :) Like you said, we'll want to add a prop to BundlingOptions
These end up getting passed here aws-cdk/packages/@aws-cdk/aws-lambda-nodejs/lib/function.ts Lines 106 to 113 in 9c094ae
And ultimately I think we'll want to add something here aws-cdk/packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts Lines 186 to 204 in 9c094ae
|
Support excluding sourcesContent from `esbuild` generated source map Closes #17256 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Support excluding sourcesContent from `esbuild` generated source map Closes aws#17256 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Description
With the
NodeJsFunction
construct, We have observed that the source code is included as part of the source maps. For production builds, We do not need this as we are not going to debug the lambda.Use Case
For production lambdas, it is desirable to omit the source code in source maps generated by esbuild through
NodeJsFunction
constructProposed Solution
In
esbuild
, there is an option we can set to disable this to not to include the source code as peresbuild
docs -https://esbuild.github.io/api/#sources-contentWe can add a property (sourcesContent) to
BundlingOptions
type and allow the function to enable/disable the inclusion of sourcesContent into the source map generated.Other information
No response
Acknowledge
The text was updated successfully, but these errors were encountered: