Skip to content

API > wxt > WxtBuilderServer

Interface: WxtBuilderServer

Contents

Properties

watcher

watcher: FSWatcher

Chokidar file watcher instance.

Source

src/types/index.ts:914


ws

ws: object

The web socket server used to communicate with the extension.

Type declaration

on()

Listen for messages over the server's websocket.

Parameters

message: string

cb: (payload) => void

send()

Send a message via the server's websocket, with an optional payload.

Parameters

message: string

payload?: any

Returns
Example
ts
ws.send("wxt:reload-extension");
ws.send("wxt:reload-content-script", { ... });

Source

src/types/index.ts:897

Methods

close()

close(): Promise<void>

Stop the server.

Source

src/types/index.ts:885


listen()

listen(): Promise<void>

Start the server.

Source

src/types/index.ts:881


transformHtml()

transformHtml(url, html, originalUrl?): Promise<string>

Transform the HTML for dev mode.

Parameters

url: string

html: string

originalUrl?: string

Source

src/types/index.ts:889


Generated using typedoc-plugin-markdown and TypeDoc