amplify-backend icon indicating copy to clipboard operation
amplify-backend copied to clipboard

Custom esbuild bundling options for esbuild

Open ErlendHer opened this issue 1 year ago • 3 comments

Environment information

-

Description

We want to be able to modify the "bundling" property of the NodejsFunction CDK definition so that we can customize how the lambda function is bundled.

Our use case is that we want to generate source maps to upload to sentry after a deployment during the pipeline

ErlendHer avatar Jun 27 '24 15:06 ErlendHer

Hey @ErlendHer :wave: thanks for raising this! We were discussing whether to enable sourcemaps by default. Is there a particular workflow you follow to upload these to Sentry? Is this something that is read from the built assets?

josefaidt avatar Jun 27 '24 16:06 josefaidt

Hey @ErlendHer 👋 thanks for raising this! We were discussing whether to enable sourcemaps by default. Is there a particular workflow you follow to upload these to Sentry? Is this something that is read from the built assets?

It depends, one can use the esbuild plugin which automatically handles it, it is also possible to upload the sourcemaps directly if using the plugin is not an option. Using the plugin would of course be the easiest in this case.

https://docs.sentry.io/platforms/javascript/guides/aws-lambda/sourcemaps/uploading/esbuild/

ErlendHer avatar Jun 27 '24 17:06 ErlendHer

any help ?

egyangel avatar Nov 15 '24 18:11 egyangel