Skip to content

API / wxt/modules / addWxtPlugin

Function: addWxtPlugin() ​

addWxtPlugin(wxt, plugin): void

Source: packages/wxt/src/modules/index.ts:139

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 ​

void

Example ​

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

Generated using typedoc-plugin-markdown and TypeDoc