Skip to content

Document cross-platform FOO=bar cmd in task commands and scripts #3140

Open

Description

@hyunbinseo

Documentation is

  • Missing

Explain in Detail

vp run parses simple commands and && chains itself, including env prefixes like FOO=bar tool --flag. The prefix is applied to the spawned process, so per the source this works on Windows too, without cross-env. (Verified on Linux; Windows read from the code, not tested.)

Other commands (pipes, redirects, $VAR, etc.) fall back to /bin/sh -c, or cmd.exe /d /s /c on Windows, where FOO=bar tool fails.

Neither is documented. command only says "The string is interpreted by a shell", which suggests cmd.exe on Windows.

Source (vite-task 9ba4cc9):

Is this a supported feature? If so, it'd be a good reason to drop cross-env.

Your Suggestion for Changes

In Compound Commands or command, document:

  • Which commands are parsed by Vite Task, and which fall back to the system shell (and which shell on Windows).
  • FOO=bar tool works on every OS when parsed, and applies only to that command (FOO=1 a && b doesn't set FOO for b).

Relevant Page

https://github.com/voidzero-dev/vite-plus/blob/main/docs/config/run.md#command

Activity

  1. jong-kyung commented on Oct 20, 2026

    @jong-kyung
    Collaborator

    Could you submit a PR?

  2. hyunbinseo commented on Oct 20, 2026

    @hyunbinseo
    ContributorAuthor

    Can my mentee @Tarte12 submit a PR? She started using Vite Plus by my recommendation and would love to contribute.

    I will review the draft PR before finalizing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions