这是indexloc提供的服务,不要输入任何密码
Skip to content

Additional arguments are passed to dependecies #1744

@majidsajadi

Description

@majidsajadi

What version of Turborepo are you using?

1.4.3

What package manager are you using / does the bug impact?

Yarn v1

What operating system are you using?

Mac

Describe the Bug

this is my turbo.json

{
  "$schema": "https://turborepo.org/schema.json",
  "pipeline": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**"]
    },
    "app#build": {
      "dependsOn": [
        "^build",
        "$VITE_APP_NAME",
      ],
      "outputs": ["dist/**"]
    },

  },
  "globalDependencies": [".env.*"]
}

and this is my package.json

{
  "workspaces": [
    "packages/*",
    "apps/*"
  ],
  "scripts": {
    "build": "turbo run build",
    "build:app": "turbo run build --filter=app"
  },
}

when i run yarn build:app -- -- --mode development the -- --mode development is passed to the app build script and all dependencies build script.

Expected Behavior

according to this in the document

Note that these additional arguments will not be passed to any additional tasks that are run due to dependencies from the pipeline configuration.

i expect the add additional arguments will not be passed to dependencies tasks

To Reproduce

turbo.json:

{
  "$schema": "https://turborepo.org/schema.json",
  "pipeline": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**"]
    },
    "app#build": {
      "dependsOn": [
        "^build",
        "$VITE_APP_NAME",
      ],
      "outputs": ["dist/**"]
    },

  },
  "globalDependencies": [".env.*"]
}

package.json:

{
  "workspaces": [
    "packages/*",
    "apps/*"
  ],
  "scripts": {
    "build": "turbo run build",
    "build:app": "turbo run build --filter=app"
  },
}
yarn run build:app -- -- --mode dev

in the log you can see mode is passed to packages too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: docsImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions