Skip to content

Commit 603ce73

Browse files
author
Nicholas Pape
authored
PNPM apparently does support --no-optional (microsoft#458)
pnpm/pnpm#460 pnpm/pnpm#783
1 parent 7c8002a commit 603ce73

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

‎apps/rush-lib/src/cli/utilities/InstallManager.ts‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ export default class InstallManager {
608608

609609
// Run "npm install" in the common folder
610610

611-
// NOTE FOR npm:
611+
// NOTE:
612612
// we do NOT install optional dependencies for Rush, as it seems that optional dependencies do not
613613
// work properly with shrinkwrap. Consider the "fsevents" package. This is a Mac specific package
614614
// which is an optional second-order dependency. Optional dependencies work by attempting to install
@@ -623,14 +623,8 @@ export default class InstallManager {
623623
// One possible solution would be to have the shrinkwrap include information about whether the dependency
624624
// is optional or not, but it does not appear to do so. Also, this would result in strange behavior where
625625
// people would have different node_modules based on their system.
626-
//
627-
// NOTE FOR pnpm:
628-
// PNPM does not appear to support the --no-optional flag at the moment
629626

630-
const installArgs: string[] = ['install'];
631-
if (this._rushConfiguration.packageManager === 'npm') {
632-
installArgs.push('--no-optional');
633-
}
627+
const installArgs: string[] = ['install', '--no-optional'];
634628
this.pushConfigurationArgs(installArgs);
635629

636630
console.log(os.EOL + colors.bold(`Running "${this._rushConfiguration.packageManager} install" in`

0 commit comments

Comments
 (0)