Skip to content

bundled node_modules bloat #166

Closed
@khuezy

Description

@khuezy

This issue is a PSA and to track future improvements to minimize lambda size.

These are dev/build deps that gets bundled, we should remove these during bundling... but for now, if you want to reduce the lambda size, manually remove them prior to deployment.

    '@esbuild',
    '@swc/core-darwin-arm64', // 33MB!
    'esbuild',
    'webpack',
    'uglify-js',
    '@webassemblyjs'

There be more, but these are the ones that take up the majority of the bloat.

NOTE: after attempting to programmatically setting this, it was too brittle to correctly handle due to the config having potential functions, which is not possible to stringify/parse the user file. And since next build runs on a child thread, we can't set the next.config at runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions