I've written a chat bot for Discord which utilises the discord.io
library. While this library provides support for voice-related automation, the installation of those features can be prevented by using the --no-optional
switch, which saves a lot of bandwidth and time.
npm install discord.io --save --no-optional
So far so good, but whether I use that option or not, there's no distinction in package.json
between the version installed with the optional dependencies and the one without, therefore when someone goes on to deploy my bot they will download and install all the unnecessary voice-related modules which I do not make use of.
Is there any kind of solution that would result in said package being installed without optional dependencies when npm install
is ran in the project folder?
This does not currently seem to be possible, as reported in npm issue #14185. You can subscribe to that bug report to track progress (if any) on this matter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With