In my yarn.lock file I have only one reference to momentjs:
pikaday@^1.6.0:
version "1.6.1"
resolved "https://registry.yarnpkg.com/pikaday/-/pikaday-1.6.1.tgz#b91bcb9b8539cedd8d6d08e4e7465e12095671b0"
optionalDependencies:
moment "2.x"
I delete all the node_modulesfolder and the yarn.lock file, and run yarn --ignore-optional but the new yarn.lock generated contains the same lines, and it installs moment in my node_modules so it gets included in my bundle.
I am running on the yarn version 0.27.5.
How can avoid to install this dep marked as optional?
Turns out Yarn indeed lists all optional dependencies at yarn.lock. However, when --ignore-optional flag is specified those modules aren't installed into node_modules/.
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