Function: defineExternalBundleRslibConfig()
defineExternalBundleRslibConfig(
userLibConfig:ExternalBundleLibConfig,encodeOptions?:EncodeOptions):RslibConfig
Get the rslib config for building Lynx external bundles.
Parameters
Returns
RslibConfig
Examples
If you want to build an external bundle which use in Lynx background thread, you can use the following code:
Then you can use lynx.loadScript('utils', { bundleName: 'utils-lib-bundle-url' }) in background thread.
If you want to build an external bundle which use in Lynx main thread, you can use the following code:
Then you can use lynx.loadScript('utils', { bundleName: 'utils-lib-bundle-url' }) in main-thread.
If you want to build an external bundle which use both in Lynx main thread and background thread. You don't need to set the layer.
Then you can use lynx.loadScript('utils', { bundleName: 'utils-lib-bundle-url' }) in background thread and lynx.loadScript('utils__main-thread', { bundleName: 'utils-lib-bundle-url' }) in main-thread.