Home > @lynx-js/externals-loading-webpack-plugin > ExternalValue
#ExternalValue interface
The value item of the externals.
Signature:
export interface ExternalValue #Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
boolean | ((context: { systemInfo: Record<string, unknown>; }) => boolean) |
(Optional) Whether the source should be loaded asynchronously. A callback is serialized into the bundle and evaluated at runtime with | ||
|
(Optional) The options of the background layer. | |||
|
string |
(Optional) The bundle path resolved against the runtime public path. Prefer this over | ||
|
string | string[] |
(Optional) The name of the library. Same as https://webpack.js.org/configuration/externals/\#string. By default, the library name is the same as the externals key. For example: The config Will generate the following webpack externals config: If one external bundle contains multiple modules, should set the same library name to ensure it's loaded only once. For example: Will generate the following webpack externals config: You can pass an array to specify subpath of the external. Same as https://webpack.js.org/configuration/externals/\#string-1. For example: Will generate the following webpack externals config: With the default | ||
|
(Optional) The options of the main-thread layer. | |||
|
number |
(Optional) The number of additional attempts when fetching the external bundle times out ( | ||
|
number |
(Optional) The wait time in milliseconds. | ||
|
string | (() => string | Promise<string>) |
(Optional) A bundle URL or a standalone resolver evaluated on first import. Resolvers must not capture build-time variables. A string result preserves synchronous loading; a Promise result requires asynchronous loading. Use this when the external bundle is hosted outside the current build output, such as on a CDN. If both |

