-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
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
Metadata
Metadata
Assignees
Labels
No labels