Skip to content

API > wxt/modules > addWxtPlugin

Function: addWxtPlugin()

addWxtPlugin(wxt, plugin): void

Add a runtime plugin to the project. In each entrypoint, before executing the main function, plugins are executed.

Parameters

wxt: Wxt

The wxt instance provided by the module's setup function.

plugin: string

An import from an NPM module, or an absolute file path to the file to load at runtime.

Returns

Example

ts
export default defineWxtModule((wxt) => {
  addWxtPlugin(wxt, "wxt-module-analytics/client-plugin");
});

Source

packages/wxt/src/modules.ts:132


Generated using typedoc-plugin-markdown and TypeDoc