-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support --no-optional on install process #282
Conversation
Codecov Report
@@ Coverage Diff @@
## master #282 +/- ##
=========================================
- Coverage 92.83% 92.8% -0.04%
=========================================
Files 27 27
Lines 1912 1917 +5
Branches 323 325 +2
=========================================
+ Hits 1775 1779 +4
- Misses 137 138 +1
Continue to review full report at Codecov.
|
// link every packages' latest version to target directory | ||
yield linkAllLatestVersion(rootPkgsMap, options); | ||
// don't link latest versions on `npminstall pkgName` way | ||
if (options.pkgs.length === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
之前的实现有 bug
all[name] = optionalDependencies[name]; | ||
prod[name] = optionalDependencies[name]; | ||
if (options.ignoreOptionalDependencies) { | ||
delete all[name]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果在 dependencies 和 optionalDependencies 中都有,也会被删掉么?npm 是这样处理的?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm 叫 --no-optional
yarn 叫 ignore-optional |
Don’t install optional dependencies. like yarn does: https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-ignore-optional
3fee87d
to
00accc3
Compare
node 4 挂了 |
3.16.0 |
Don’t install optional dependencies.
like yarn does: https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-ignore-optional