Skip to content

Proposal: do not forward extra vp run arguments to dependsOn tasks by default #324

@SegaraRai

Description

@SegaraRai

Summary

When running:

vp run <task> <extra-args...>

the extra args are also forwarded to dependsOn tasks.

I think this should not be the default.

Rationale

A common pattern is:

  • test depends on build
  • check depends on build

But the accepted args are often different.

For example:

  • test may accept a file path or filter
  • build may accept no extra args

So this:

vp run test some-filter

can end up passing some-filter to build too, even though it only makes sense for test.

That makes dependsOn harder to use for build-before-test or build-before-check workflows.

Proposal

By default:

  • extra args should be passed only to the explicitly requested task
  • dependsOn tasks should not receive them

So:

vp run test some-filter

should pass some-filter to test, but not to build.

If there is a use case for the current behavior, an explicit opt-in would make more sense than the current default.

Minimal repro

https://github.com/SegaraRai/vitetask-repro02

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions