What happen to --ignore-optional? #2412
-
There used to be a There is no mention of this command in the migration guide or the rename guide, Currently, as far as my knowledges goes, the only way to achieve that previous behavior is to modify the package.json before running Can you recommend a solution and/or add a note about that in the documentation? Thanks a lot, |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 3 replies
-
thanks for the move @merceyz, not used to this feature 😬 |
Beta Was this translation helpful? Give feedback.
-
It has been removed. It's not so much because of its instability, but rather because noone used it right, and it wasn't very helpful to begin with. Optional dependencies, as defined by the Generally speaking we don't really want to support "partial views" of your project in the core unless we can guarantee the result will make sense. So for instance, we have If you want to reintroduce it, you can do so by either calling |
Beta Was this translation helpful? Give feedback.
-
@arcanis any workaround we can use to remove these optional dependencies? I was able to do it manually but it isn't user friendly. I am having compiling issues because of having optional dependencies in node_modules that have peer dependencies. If I have this specific optional dependency installed I am forced to install a bunch of dependencies I don't need to make the build process work. |
Beta Was this translation helpful? Give feedback.
-
looking for same |
Beta Was this translation helpful? Give feedback.
-
At least, provide a possibility to ignore specific packages during |
Beta Was this translation helpful? Give feedback.
-
Sounds like pretty logical not to ignore optionalDeps during install, since I found that in my own case, when I ran |
Beta Was this translation helpful? Give feedback.
-
It makes sense to me that we should be able to skip all optional packages. It seems like there are some good use cases to selectively have different execution environments as an optimization which can be e.g. validated by CI running in the environment lacking the optional dependencies.... It would be ok to stamp the documentation with 'Here be dragons/Tread carefully' on this feature imo. |
Beta Was this translation helpful? Give feedback.
It has been removed. It's not so much because of its instability, but rather because noone used it right, and it wasn't very helpful to begin with. Optional dependencies, as defined by the
optionalDependencies
flag, and that we still support, only have their build optional. The packages are still fetched, and still installed - it's just that if they have built steps, then errors that could happen then are downgraded into warnings. As such, not installing those packages at all would be technically incorrect as it would produce a different execution environment in different cases.Generally speaking we don't really want to support "partial views" of your project in the core unless we can gu…