Skip to content

Add a "vite clean" command #10986

@EmperorArthur

Description

@EmperorArthur

Description

Many other build systems have a "Clean" command or equivalent that removes all caches and the build files/output folder.

While this is a minor thing I believe it would be useful.

Suggested solution

Add a "clean" command which calls the current output folder and cache cleaning functions.
Also add a "--force" option for dealing with the output folder being outside of the root, without having to modify the config.

Alternative

No response

Additional context

This came about because Vite preserves the "Read-only" status of files when copying on Windows. msbuild then refuses to remove them because they have that flag set. Meaning the only solution is to brute force a custom executable target and pray I don't mess up the path.

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestp2-to-be-discussedEnhancement under consideration (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions