You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users of the intl-tel-input npm package need the CSS and JavaScript utilities located in the build directory, and do not need to install any of the dependencies, submodules and other tooling of the repository.
Currently, the npm package copies the content of the whole github repository at each install, including the content of libphonenumber dependency, which consumes more than 100 MB of disk space.
This is problematic in multiple ways:
the package takes a long time to download whenever installing with a slow Internet connection
the package takes a long time to decompress on low spec, slow hardware
the size of the package might create challenges when using in programs installed on low spec hardware
consequently, the programs using the package suffer from the same problem: they are slower to install and deploy, and consume a lot of disk space unnecessarily.
all the overhead has a negative impact on the environment as it causes unneeded energy consumption - even if this impact is negligible compared to other factors.
Steps to reproduce
Navigate to an empty directory
Execute the command npm install intl-tel-input
Check the installed packages and the space they use du -sh node_modules/*
Check the number of files installed find node_modules/ -type f | wc -l
Expected behaviour
The only node.js module installed is intl-tel-input
The number of files installed is small, definitely less than a hundred files
The disk space used by the module is small, ideally less than a megabyte
Actual behaviour
8 packages are installed in addition to intl-tel-input
3975 files are present inside node_modules directory
node_modules directory consumes 122MB of disk space
Users of the
intl-tel-input
npm package need the CSS and JavaScript utilities located in thebuild
directory, and do not need to install any of the dependencies, submodules and other tooling of the repository.Currently, the npm package copies the content of the whole github repository at each install, including the content of
libphonenumber
dependency, which consumes more than 100 MB of disk space.This is problematic in multiple ways:
Steps to reproduce
npm install intl-tel-input
du -sh node_modules/*
find node_modules/ -type f | wc -l
Expected behaviour
intl-tel-input
Actual behaviour
intl-tel-input
node_modules
directorynode_modules
directory consumes 122MB of disk spaceCurrent output of
du -sh node_modules/*
:Initialisation options
N/A
Proposed solution
react
,react-dom
andprop-types
fromdependencies
todevDependencies
insidepackage.json
.files
property insidepackage.json
in order to specify which files should be included in the npm package.For example, the following setup decreases the size to 25 files, using 1.2MB (100x reduction):
The text was updated successfully, but these errors were encountered: