Skip to content

Vite for Gradle

General purpose Gradle plugin to use Vite without preconfigured behavior.

Use Vite in your own terms

Use this plugin to integrate Vite into your build processes exactly how you want it.

To avoid manually configuring Vite, use one of the other modules in this project, which are pre-configured to be compatible with other parts of the Gradle ecosystem.

Usage

Import the plugin in your build script:

// build.gradle.kts
plugins {
    id("dev.opensavvy.vite.base") version "<add the version here>"
}

The plugin automatically creates theviteextension block, but it creates no tasks nor other behavior. To access it, use theviteConfigaccessor.

Task types

This plugin exposes multiple task types that you can use to create your own build.

Note that it is the user's responsibility to install Vite and other dependencies.

Packages

opensavvy.gradle.vite.base

The Gradle plugin itself as well as the vite extension.

opensavvy.gradle.vite.base.config

The different configuration options.

opensavvy.gradle.vite.base.dump

A convenient task to dump the configuration of the plugin to the standard output.

opensavvy.gradle.vite.base.tasks

The implementation of the different tasks.