Skip to content
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

Evaluate lib size for all packages used in serverless #17

Open
purplecabbage opened this issue Apr 1, 2021 · 0 comments
Open

Evaluate lib size for all packages used in serverless #17

purplecabbage opened this issue Apr 1, 2021 · 0 comments

Comments

@purplecabbage
Copy link
Member

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

@meryllblanchet meryllblanchet transferred this issue from adobe/aio-cli Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant