Vite for Gradle • opensavvy.gradle.vite.base.config • ExternalVitePlugin
ExternalVitePlugin¶
data class ExternalVitePlugin(val exportedAs: String, val packageName: String, val version: String, val configuration: String? = null, val isNamedExport: Boolean = false) : Serializable
An external plugin for Vite downloaded via NPM.
Multiple lists of plugins are available:
-
Third-party plugins listed by the awesome-vite project.
Examples¶
To understand how to create an instance of this class, read the configuration example provided by the plugin. Generally, a plugin is installed like so:
The declaration should be:
If additional configuration is needed, for example like so:
// vite.config.js
import vue from '@vitejs/plugin-vue'
export default {
plugins: [
vue({
template: {
compilerOptions: {
// ...
},
},
}),
],
}
The declaration should be:
Constructors¶
ExternalVitePlugin
¶
Properties¶
configuration
¶
val configuration: String? = null
Any additional configuration provided to the plugin.
exportedAs
¶
val exportedAs: String
The name of the function exported by this plugin.
isNamedExport
¶
val isNamedExport: Boolean = false
If true
, the configuration will be generated as import {name} from 'foo'
, whereas if false
the configuration will be generated as import name from 'foo'
.
packageName
¶
val packageName: String
The name of the NPM package which contains this plugin.
version
¶
The version of the project, as it appears on NPM.