Skip to content

Evaluate lib size for all packages used in serverless #17

@purplecabbage

Description

@purplecabbage

In making the aio-lib-env library work with webpack and serverless actions I noticed some size issues.
This is not a reflection of aio-lib-env, just the way npm packages work ...
aio-lib-env is used as an example because it is probably our smallest module, 74 LOC including license header
BundlePhobia reports it has a minified size of 348.4 kB [1]

Adding to an action

a simple action with a dependency on node-fetch and nothing else:

du -sh dist/actions/list-temp 
384K	dist/actions/list-temp
du -sh dist/actions/list.zip       
180K	dist/actions/list.zip

add + build

const { getCliEnv, DEFAULT_ENV } = require('@adobe/aio-lib-env') and console.log('getCliEnv => ', getCliEnv())

du -sh dist/actions/list-temp 
1.3M	dist/actions/list-temp
du -sh dist/actions/list.zip 
388K	dist/actions/list.zip

Most of this is probably the logging lib, which includes winston, ... but the simple fact that this lib is so small really shows the point.

An action that uses aio-sdk only

const { Core } = require('@adobe/aio-sdk')

du -sh dist/actions/list-temp 
6.5M	dist/actions/list-temp
du -sh dist/actions/list.zip 
1.4M	dist/actions/list.zip

Adding back @adobe/aio-lib-env has no effect if @adobe/aio-sdk is already there ...

du -sh dist/actions/list-temp 
6.5M	dist/actions/list-temp
du -sh dist/actions/list.zip 
1.4M	dist/actions/list.zip

1 : bundlephobia aio-lib-env

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