Open
Description
The installation size of the patch-package
is reaching 2.33 MiB:

(https://packagephobia.com/result?p=patch-package)
And here is the current npm dependency graph of the patch-package
:
https://npmgraph.js.org/?q=patch-package#zoom=w

I am wondering if we can reduce the installation size. And here is what I propose:
- Replace
[email protected]
withpicocolors
- The
picocolors
is "14 times smaller and 2 times faster than chalk", and is used by popular libraries like postcss, autoprefixer, and stylelint. - We can reduce the installation size by 94 KiB: https://packagephobia.com/result?p=chalk%404.1.2, https://packagephobia.com/result?p=picocolors
- The
- Replace
[email protected]
with the Node.js built-infs
API- The Node.js built-in
fs
API has been improving and evolving, Andpatch-package@8
is targeting Node.js 14+ already. - We can reduce the installation size by 185 KiB: https://packagephobia.com/result?p=fs-extra%409.1.0
- The Node.js built-in
- Replace
[email protected]
with the Node.js built-infs.rm
API- Node.js has introduced the
rm -rf
-likefs.rm
API, and it has been available since Node.js 14.14.0 - We can reduce the installation size by 166 KiB: https://packagephobia.com/[email protected]
- Node.js has introduced the
- Replace
json-stable-stringify
withfast-json-stable-stringify
- The
json-stable-stringify
is shipped with aJSON
polyfill (jsonify
). But we don't need theJSON
polyfill sincepatch-package@8
is targeting Node.js 14+. - We can reduce the installation size by 25 KiB: https://packagephobia.com/result?p=json-stable-stringify, https://packagephobia.com/result?p=fast-json-stable-stringify
- The
Together we can reduce the installation size of the patch-package
by 470
KiB.
@ds300 What do you think?
Metadata
Metadata
Assignees
Labels
No labels