Vite for Gradle • opensavvy.gradle.vite.base.config • ViteConfig
ViteConfig¶
interface ViteConfig
The main configuration block, exposed by the vite
extension:
Properties¶
base
¶
Base public path when served in development or production.
build
¶
abstract val build: ViteBuildConfig
Configuration for Rollup to build the production bundle.
plugins
¶
@get:
Internal
abstract val plugins: ListProperty<ExternalVitePlugin>
The list of Vite plugins from NPM imported by this project.
publicDir
¶
Directory to serve as plain static assets. Files in this directory are served at /
during dev and copied to the root outDir
during build, and are always served or copied as-is without transform.
root
¶
@get:
Internal
abstract val root: DirectoryProperty
Project root directory, where index.html
is located.
server
¶
abstract val server: ViteServerConfig
Configuration for the development server.
version
¶
The version of the Vite package used by this build.
Functions¶
build
¶
open fun build(block: ViteBuildConfig.() -> Unit): ViteBuildConfig
plugin
¶
Imports a plugin from NPM.
server
¶
open fun server(block: ViteServerConfig.() -> Unit): ViteServerConfig
setDefaults
¶
open fun setDefaults()
Sets the default values for all configuration fields.
setDefaultsFrom
¶
open fun setDefaultsFrom(other: ViteConfig)