/** * This source file is available under the terms of the * Pimcore Open Core License (POCL) * Full copyright and license information is available in * LICENSE.md which is distributed with this source code. * * @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com) * @license Pimcore Open Core License (POCL) */ /* * Hand-written rather than generated: entrypoints.mjs is plain ESM that runs in the plugin * author's BUILD, not code compiled from this package's TypeScript source, so there is nothing * for tsc to emit. Keeping it hand-written also keeps @rsbuild/core out of the package's * dependencies — the return type is structural, so a consumer's own rsbuild satisfies it. * * Named .d.mts, not .d.ts: for a `.mjs` file TypeScript looks for `.d.mts` and nothing else. As * `.d.ts` it resolved through the package exports map (which names the types file explicitly) * but NOT for a direct relative import — which silently degraded the helper to `any`, TS7016. * The demo plugin caught that the first time it was type-checked. */ export interface PortalEntrypointsOptions { /** * Module Federation remote name. Must be a valid JS identifier: it becomes a property name * in the generated exposeRemote.js, so kebab-case emits broken JavaScript that fails * silently. The plugin throws on a bad name rather than letting that reach a browser. */ remoteName: string /** Web path the bundle is served from, no trailing slash — e.g. '/bundles/myplugin'. */ assetPrefix: string /** Absolute filesystem path the build writes to. */ distPath: string /** Defaults to 'static/js/remoteEntry.js'; match pluginModuleFederation's `filename`. */ remoteFilename?: string /** Appended to the remote alias when the plugin exposes its IAbstractPlugin elsewhere than '.'. */ exportPath?: string /** Absolute origin to prefix URLs with; only needed when a dev server serves from another origin. */ origin?: string } /** Minimal structural shape of an rsbuild plugin — avoids depending on @rsbuild/core here. */ export interface PortalEntrypointsPlugin { name: string setup: (api: { onAfterBuild: (fn: () => void) => void onDevCompileDone: (fn: () => void) => void }) => void } /** * Emits the two files portal-engine needs from a plugin build: entrypoints.json (what the * provider points at) and exposeRemote.js (which registers the remote into * window.pluginRemotes). */ export declare const pluginPortalEntrypoints: ( options: PortalEntrypointsOptions ) => PortalEntrypointsPlugin