Skip to content

ViteExec

@CacheableTask



abstract class ViteExec @Inject



 constructor(process: ExecOperations) : DefaultTask

Executes a Vite command in the context of this project.

For example, to run vite build:

tasks.register("viteBuild", ViteExec::class) {
    command.set("build")
    workingDirectory.set(project.layout.buildDirectory.dir("foo").asFile.toString())

    nodePath.set("…path to your Node installation…")
    vitePath.set("…path to your Vite installation…")
}

Constructors

ViteExec

@Inject



constructor(process: ExecOperations)

Properties

actions

open var actions: List<Action<in Task>>

ant

open val ant: AntBuilder

arguments

@get:



Input



abstract val arguments: ListProperty<String>

Arguments passed to command.

asDynamicObject

@get:



Internal



open val asDynamicObject: DynamicObject

command

@get:



Input



@get:



Optional



abstract val command: Property<String>

The Vite command to execute, for example run or build.

config

fun config(block: ViteConfig.() -> Unit): ViteConfig
abstract val config: ViteConfig

The Vite configuration.

configurationFile

@get:



InputFile



@get:



PathSensitive



(value = PathSensitivity.RELATIVE)abstract val configurationFile: RegularFileProperty

The path to the vite.config.js file.

dependsOn

open val dependsOn: Set<Any>

description

open var description: @Nullable



 String?

destroyables

open val destroyables: TaskDestroyables

didWork

open var didWork: Boolean

enabled

open var enabled: Boolean

extensions

open val extensions: ExtensionContainer

finalizedBy

open val finalizedBy: TaskDependency

group

open var group: @Nullable



 String?

identityPath

open val identityPath: Path

impliesSubProjects

inputs

open val inputs: TaskInputsInternal

isCompatibleWithConfigurationCache

isEnabled

@get:



Internal



open var isEnabled: Boolean

isHasCustomActions

lifecycleDependencies

@get:



Internal



open val lifecycleDependencies: TaskDependencyInternal

localState

open val localState: TaskLocalState

logger

open val logger: Logger

logging

open val logging: LoggingManager

mustRunAfter

open val mustRunAfter: TaskDependency

name

open val name: String

nodePath

@get:



Internal



abstract val nodePath: RegularFileProperty

The path to the Node executable.

Use this property to override which Node installation is used. By default, the Node installation used by the Kotlin plugin is used.

onlyIf

open val onlyIf: Spec<in TaskInternal>

outputs

open val outputs: TaskOutputsInternal

path

open val path: String

project

open val project: Project

reasonNotToTrackState

reasonsNotToTrackState

reasonTaskIsIncompatibleWithConfigurationCache

requiredServices

open val requiredServices: TaskRequiredServices

sharedResources

open val sharedResources: List<ResourceLock>

shouldRunAfter

open val shouldRunAfter: TaskDependency

standardOutputCapture

open val standardOutputCapture: StandardOutputCapture

state

open val state: TaskStateInternal

taskActions

open val taskActions: List<InputChangesAwareTaskAction>

taskDependencies

open val taskDependencies: TaskDependencyInternal

taskIdentity

open val taskIdentity: TaskIdentity<*>

temporaryDir

open val temporaryDir: File

temporaryDirFactory

open val temporaryDirFactory: Factory<File>

timeout

open val timeout: Property<Duration>

vitePath

@get:



InputFile



@get:



PathSensitive



(value = PathSensitivity.RELATIVE)abstract val vitePath: RegularFileProperty

The path to the Vite executable.

Use this property to override which Vite installation is used. By default, Vite is installed as a development dependency of the project in which this plugin is applied.

workingDirectory

@get:



Input



abstract val workingDirectory: Property<String>

The directory in which the command will be executed.

Functions

acceptServiceReferences

open fun acceptServiceReferences(serviceReferences: Set<ServiceReferenceSpec>)

appendParallelSafeAction

open fun appendParallelSafeAction(action: Action<in Task>)

compareTo

open operator fun compareTo(otherTask: Task): Int

configure

open fun configure(closure: Closure<*>): Task

dependsOn

open fun dependsOn(vararg paths: Any): Task

doFirst

open fun doFirst(action: Closure<*>): Task
open fun doFirst(action: Action<in Task>): Task
open fun doFirst(actionName: String, action: Action<in Task>): Task

doLast

open fun doLast(action: Closure<*>): Task
open fun doLast(action: Action<in Task>): Task
open fun doLast(actionName: String, action: Action<in Task>): Task

doNotTrackState

open fun doNotTrackState(reasonNotToTrackState: String)

doNotTrackStateIf

open fun doNotTrackStateIf(reason: String, spec: Spec<in TaskInternal>)

execute

fun execute()

finalizedBy

open fun finalizedBy(vararg paths: Any): Task

hasProperty

open fun hasProperty(propertyName: String): Boolean

hasTaskActions

open fun hasTaskActions(): Boolean

mustRunAfter

open fun mustRunAfter(vararg paths: Any): Task

notCompatibleWithConfigurationCache

onlyIf

open fun onlyIf(onlyIfClosure: Closure<*>)
open fun onlyIf(spec: Spec<in Task>)
open fun onlyIf(onlyIfReason: String, spec: Spec<in Task>)

prependParallelSafeAction

open fun prependParallelSafeAction(action: Action<in Task>)

property

open fun property(propertyName: String): Any

restoreOnlyIf

open fun restoreOnlyIf(onlyIf: Spec<in TaskInternal>)

restoreTaskActions

open fun restoreTaskActions(taskActions: List<InputChangesAwareTaskAction>)

setDependsOn

open fun setDependsOn(dependsOn: Iterable<*>)

setFinalizedBy

open fun setFinalizedBy(finalizedByTasks: Iterable<*>)

setMustRunAfter

open fun setMustRunAfter(mustRunAfterTasks: Iterable<*>)

setOnlyIf

open fun setOnlyIf(onlyIfClosure: Closure<*>)
open fun setOnlyIf(spec: Spec<in Task>)
open fun setOnlyIf(onlyIfReason: String, spec: Spec<in Task>)

setProperty

open fun setProperty(name: String, value: Any)

setShouldRunAfter

open fun setShouldRunAfter(shouldRunAfterTasks: Iterable<*>)

shouldRunAfter

open fun shouldRunAfter(vararg paths: Any): TaskDependency

usesService

open fun usesService(service: Provider<out BuildService<*>>)