Skip to content

API > wxt > BackgroundDefinition

Interface: BackgroundDefinition ​

Contents ​

Extends ​

Properties ​

exclude ​

exclude?: string[]

List of target browsers to exclude this entrypoint from. Cannot be used with include. You must choose one of the two options.

Default ​

ts
undefined

Inherited from ​

BackgroundEntrypointOptions.exclude

Source ​

packages/wxt/src/types.ts:673


include ​

include?: string[]

List of target browsers to include this entrypoint in. Defaults to being included in all builds. Cannot be used with exclude. You must choose one of the two options.

Default ​

ts
undefined

Inherited from ​

BackgroundEntrypointOptions.include

Source ​

packages/wxt/src/types.ts:666


persistent ​

persistent?: PerBrowserOption<boolean>

Inherited from ​

BackgroundEntrypointOptions.persistent

Source ​

packages/wxt/src/types.ts:677


type ​

type?: PerBrowserOption<"module">

Set to "module" to output the background entrypoint as ESM. ESM outputs can share chunks and reduce the overall size of the bundled extension.

When undefined, the background is bundled individually into an IIFE format.

Default ​

ts
undefined

Inherited from ​

BackgroundEntrypointOptions.type

Source ​

packages/wxt/src/types.ts:687

Methods ​

main() ​

main(): void

Main function executed when the background script is started. Cannot be async.

Source ​

packages/wxt/src/types.ts:1038


Generated using typedoc-plugin-markdown and TypeDoc