Reduce package installation size
The current installation size of the package may discourage its integration into other projects or packages that want to keep their size as low as possible (as mentioned in #687).
The installation size has increased significantly over releases, especially on 2.x, 5.x and 7.x:
1.15.2 |
2.1.0 |
3.1.0 |
4.3.0 |
5.3.0 |
6.2.5 |
7.2.3 |
|---|---|---|---|---|---|---|
| 1.38 MB | 3.01 MB | 3.01 MB | 3.89 MB | 10.5 MB | 10.7 MB | 16.3 MB |
98% of the installation size comes from 5 dependencies:
| Dependency | Install | % |
|---|---|---|
node-fetch |
7.45 MB | 47 % |
@types/node |
3.50 MB | 22 % |
@types/fs-extra |
3.45 MB | 22 % |
yaml |
636 kB | 4 % |
globby |
577 kB | 4 % |
ps-tree |
131 kB | 1 % |
fs-extra |
114 kB | 1 % |
minimist |
53.2 kB | 0 % |
chalk |
42.5 kB | 0 % |
fx |
19.5 kB | 0 % |
which |
17.7 kB | 0 % |
@types/minimist |
7.17 kB | 0 % |
@types/which |
5.26 kB | 0 % |
@types/ps-tree |
4.45 kB | 0 % |
webpod |
357 B | 0 % |
The package size could be drastically reduced (-90%) by:
- [ ] Removing
node-fetch(#687, #589): -47% - [ ] Moving
@types/*to dev (and optional?) dependencies: -44%- These types can still be installed if needed by TypeScript users
- [ ] Removing
fs-extraand@types/fs-extra(#589): -22%
Tasks 1 and 3 are already planned for v8, could you consider the 2nd one as well? Thanks 🙂
Moving @types/* to dev (and optional?) dependencies: -44% These types can still be installed if needed by TypeScript users
Yeap. We are going to build zx with esbuild and we can build .d.ts as well.
Good news. We have a proposal, that reaches the 414Kb point (4.33MB with optional @types/fs-extra and @types/node)
https://packagephobia.com/result?p=%40antongolub%2Fzx%2C+zx
🎉 Awesome work @antongolub