import type { Rspack } from '@rslib/core'; /** * The options for {@link ExternalBundleWebpackPlugin}. * * @public */ export interface ExternalBundleWebpackPluginOptions { /** * The external bundle filename. * * @example * ```js * new ExternalBundleWebpackPlugin({ * bundleFileName: 'lib.lynx.bundle' * }) * ``` */ bundleFileName: string; /** * The encode method which is exported from lynx-tasm package. * * @example * ```js * import { getEncodeMode } from '@lynx-js/tasm'; * * new ExternalBundleWebpackPlugin({ * encode: getEncodeMode() * }) * ``` */ encode: (opts: unknown) => { buffer: Buffer; } | Promise<{ buffer: Buffer; }>; /** * The engine version of the external bundle. * * @defaultValue '3.5' */ engineVersion?: string | undefined; /** * The main thread chunks of the external bundle. * * @defaultValue [] */ mainThreadChunks?: string[] | undefined; /** * Whether to tag main thread chunks with the `JsBytecode` encoding so the * encoder compiles them to bytecode. * * @remarks * When disabled, main thread chunks are encoded as plain JavaScript source, * which keeps them readable for debugging and speeds up encoding. * * @defaultValue `false` when `NODE_ENV` is `'development'`, otherwise `true` */ enableJsBytecode?: boolean | undefined; } /** * The webpack plugin to build and emit the external bundle. * * @public */ export declare class ExternalBundleWebpackPlugin { #private; private options; constructor(options: ExternalBundleWebpackPluginOptions); apply(compiler: Rspack.Compiler): void; }