Last Updated: February 25, 2016
· DamonOehlman

NPM package.json optionalDependencies

Initially I thought that the packages in the optionalDependencies section would not be installed automatically (at least for a production install). This is in fact not the case. An install is attempted, it's just that failure is package install failure is tolerated...

For this reason, I've started using a custom pluginDependencies section for packages that I'm using squirrel with to achieve a lightweight core install and only install those plugin dependencies when required. This is particularly useful when you are supporting libraries such as Jade, Stylus, Coffee-Script, etc which may not be to everyone's tastes...

1 Response
Add your response

Correct me if I'm wrong, but I believe this is now superseded by node core's peer dependencies:

over 1 year ago ·