diff --git a/packages/pnpm/src/main.ts b/packages/pnpm/src/main.ts index aaaff22bca5..2025c648390 100644 --- a/packages/pnpm/src/main.ts +++ b/packages/pnpm/src/main.ts @@ -197,7 +197,7 @@ export default async function run (inputArgv: string[]) { const relativeWSDirPath = () => path.relative(process.cwd(), wsDir) || '.' if (config.workspaceRoot) { filters.push({ filter: `{${relativeWSDirPath()}}`, followProdDepsOnly: false }) - } else if (cmd === 'run' || cmd === 'exec' || cmd === 'add' || cmd === 'test') { + } else if (!cliOptions['include-workspace-root'] && (cmd === 'run' || cmd === 'exec' || cmd === 'add' || cmd === 'test')) { filters.push({ filter: `!{${relativeWSDirPath()}}`, followProdDepsOnly: false }) }