Skip to content

Universal DevTools Kit SDK


Universal DevTools Kit SDK / @u-devtools/core / DevToolsPlugin

Interface: DevToolsPlugin ​

Defined in: index.ts:603

DevTools Plugin Definition - Server-side plugin configuration. Defines a plugin's structure and entry points for all three execution contexts.

Created using definePlugin() helper from @u-devtools/kit/define-plugin.

Example ​

ts
import { definePlugin } from '@u-devtools/kit/define-plugin';

export default definePlugin({
  name: 'My Plugin',
  root: import.meta.url,
  client: './client',
  app: './app',
  server: './server',
});

Properties ​

appPath? ​

optional appPath: string

Defined in: index.ts:609

Absolute path to app.ts file (App context - main window)


clientPath? ​

optional clientPath: string

Defined in: index.ts:607

Absolute path to client.ts file (Client context)


meta? ​

optional meta: PluginMetadata

Defined in: index.ts:618

Plugin metadata (name, version, description, etc.)


name ​

name: string

Defined in: index.ts:605

Display name of the plugin


setupServer()? ​

optional setupServer: (rpc, ctx) => void

Defined in: index.ts:616

Server-side setup function (Server context - Node.js). Called when plugin is loaded to register RPC handlers.

Parameters ​

ParameterTypeDescription
rpcRpcServerInterfaceRPC server interface for handling requests
ctxServerContextServer context with root path and Vite server instance

Returns ​

void


vitePlugins? ​

optional vitePlugins: () => PluginOption | PluginOption[][]

Defined in: index.ts:623

Optional Vite plugins to be merged with the main DevTools plugin. These plugins will be added to the Vite configuration.

Returns ​

PluginOption | PluginOption[]

Released under the MIT License.