Home > @lynx-js/externals-loading-webpack-plugin > ExternalValue
ExternalValue interface
The value item of the externals.
Signature:
Properties
Will generate the following webpack externals config:
```js externals: { lodash: 'lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")].lodash', } ```If one external bundle contains multiple modules, should set the same library name to ensure it's loaded only once. For example:
```js ExternalsLoadingPlugin({ externals: { lodash: { libraryName: 'Lodash', url: '……', }, 'lodash-es': { libraryName: 'Lodash', url: '……', } } }) ```Will generate the following webpack externals config:
```js externals: { lodash: 'lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")].Lodash', 'lodash-es': 'lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")].Lodash', } ```You can pass an array to specify subpath of the external. Same as https://webpack.js.org/configuration/externals/\#string-1. For example:
```js ExternalsLoadingPlugin({ externals: { preact: { libraryName: ['ReactLynx', 'Preact'], url: '……', }, } }) ```Will generate the following webpack externals config:
```js externals: { preact: 'lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")].ReactLynx.Preact', } ``` | | [mainThread?](./externals-loading-webpack-plugin.externalvalue.mainthread.md) | | [LayerOptions](./externals-loading-webpack-plugin.layeroptions.md) | _(Optional)_ The options of the main-thread layer. | | [timeout?](./externals-loading-webpack-plugin.externalvalue.timeout.md) | | number | _(Optional)_ The wait time in milliseconds. | | [url](./externals-loading-webpack-plugin.externalvalue.url.md) | | string | The bundle url of the library. The library source should be placed incustomSections. |
