Skip to content

Node.js esbuild support for --main-fields properties #4093

@santiperone

Description

@santiperone

Describe your idea/feature/enhancement

When running the beta features for esbuild, I noticed large bundle sizes for functions using aws-sdk v3 packages.
After some further research, I found this thread: aws/aws-sdk-js-v3#3023 which points out to specifying --main-fields=module,main when bundling with the sdk to allow for better tree shaking. This made my bundle go from:
image
to:
image

Proposal

Add the ability to set this property in the template, to allow for lower sizes bundles. It could be added as an additional properti inside the "BuildProperties"

Metadata

Metadata

Assignees

No one assigned

    Labels

    stage/waiting-for-releaseFix has been merged to develop and is waiting for a releasetype/featureFeature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions