Home > @lynx-js/external-bundle-rsbuild-plugin > pluginExternalBundle

pluginExternalBundle() function

Create a rsbuild plugin for loading external bundles.

Signature:

export declare function pluginExternalBundle(options: PluginExternalBundleOptions): RsbuildPlugin;

Parameters

ParameterTypeDescription
optionsPluginExternalBundleOptionsPlugin options.

Returns:

RsbuildPlugin

Example

import { pluginExternalBundle } from '@lynx-js/external-bundle-rsbuild-plugin'
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'

export default {
  plugins: [
    pluginReactLynx(),
    pluginExternalBundle({
      externalsPresets: {
        reactlynx: true,
      },
      externals: {
        './App.js': 'comp-lib.lynx.bundle',
      },
      globalObject: 'globalThis',
    }),
  ],
}
Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.