> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# Interface: PluginExternalBundleOptions

Options for the external-bundle-rsbuild-plugin.

## Extends

- `Pick`\<`ExternalsLoadingPluginOptions`, `"globalObject"` | `"timeout"` | `"retries"`>

## Properties

### externalBundleRoot?

> `optional` **externalBundleRoot?**: `string`

Root directory that stores project-owned external bundles referenced by
`bundlePath`.

`pluginExternalBundle` uses this directory for both development serving
and build-time asset emission. Prefer setting this explicitly when
external bundles are built into a separate output folder, such as
`dist-external-bundle`.

***

### externals?

> `optional` **externals?**: `Record`\<`string`, [`PluginExternalConfig`](/next/api/packages/external-bundle-rsbuild-plugin/type-aliases/PluginExternalConfig.md)>

Additional explicit externals to load.

***

### externalsPresetDefinitions?

> `optional` **externalsPresetDefinitions?**: [`ExternalsPresetDefinitions`](/next/api/packages/external-bundle-rsbuild-plugin/type-aliases/ExternalsPresetDefinitions.md)

Definitions for custom externals presets enabled by `externalsPresets`.

Use this to add business-specific presets such as `lynxUi`, or to extend a
built-in preset through `extends`.

***

### externalsPresets?

> `optional` **externalsPresets?**: [`ExternalsPresets`](/next/api/packages/external-bundle-rsbuild-plugin/interfaces/ExternalsPresets.md)

Presets for external libraries.

Same as [https://rspack.rs/config/externals#externalspresets](https://rspack.rs/config/externals#externalspresets) but for Lynx.

***

### globalObject?

> `optional` **globalObject?**: `"lynx"` | `"globalThis"`

This option indicates what global object will be used to mount the library.

In Lynx, the library will be mounted to `lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")]` by default.

If you have enabled share js context and want to reuse the library by mounting to the global object, you can set this option to `'globalThis'`.

#### Default

```ts
'lynx'
```

#### Inherited from

`Pick.globalObject`

***

### retries?

> `optional` **retries?**: `number`

The number of additional attempts when fetching the external bundle times out (`response.code === -2`).

#### Default Value

```ts
0
```

#### Inherited from

`Pick.retries`

***

### timeout?

> `optional` **timeout?**: `number`

The timeout in milliseconds for loading the externals.

#### Default Value

```ts
2000
```

#### Inherited from

`Pick.timeout`
