localPlugin

open fun localPlugin(path: String, exportedAs: String, version: String = "*", configuration: String? = null, isNamedExport: Boolean = false)(source)

Imports a local file as a Vite plugin.

Local plugins are not added to package.json and are not downloaded. For more information, see ExternalVitePlugin.isLocal.

This is a helper function to add an element to plugins. For more information on the different parameters, see ExternalVitePlugin.

Example

vite {
localPlugin("../../../../vite.config.d/myplugin.mjs", "myplugin")
}