adobe / adobe/aio-cli

size audit of aio-cli node_modules, improvement suggestions

Open
#349 5 comments 0 reactions 1 assignee Claimed by @purplecabbage View on GitHub
enhancement
Dominant language
JavaScript
Stars
95
Forks
45
PR merge metrics
No merged PRs in 30d

Description

Only listing those with at least double digit sizes in megabytes, and only for a production build via `npm i --production`.
Total size of `node_modules` is `466M`

```
$ du | sort -nr | cut -f2- | xargs du -hs
466M .
144M ./@parcel
128M ./@parcel/transformer-js
68M ./aws-sdk
32M ./aws-sdk/clients
17M ./aws-sdk/dist
17M ./rxjs
16M ./yeoman-environment
16M ./yeoman-environment/node_modules
15M ./aws-sdk/apis
15M ./@adobe
11M ./yeoman-environment/node_modules/rxjs
```

`@parcel/transformer-js` is the biggest, mainly because it includes pre-built native binding `.node` files for all the platforms. This can be optimized by not including `.node` files that are not used by the current platform. There is nothing we can do however to affect this, since the `.node` files are packed into the tarball for the package version, and not compiled post-install per platform. The linux `.node` files themselves contribute `90M`. Parcel is used in the app plugin for `aio app run`.

`aws-sdk` is used in @adobe/aio-lib-web which is in turn used by the app plugin for deploy/undeploy (for S3 only). This is v2 of the sdk - we can improve this if we move to v3 where each service has its own package, and we only use S3.

`yeoman-environment` is used by the app plugin, to run the yeoman generators when creating an app. The bulk of it is rxjs@7.

`rxjs` is used by multiple modules - events plugin (events-lib), inquirer (cli UI). v6 is 17M.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.