// plugin-markdown/src/index.ts
import { Plugin } from '@dxos/app-framework';
import { meta } from './meta';
export const MarkdownPlugin = Plugin.lazy(meta, () => import('./MarkdownPlugin'));
// plugin-markdown/src/MarkdownPlugin.tsx
export const MarkdownPlugin = Plugin.define(meta).pipe(...heavy modules..., Plugin.make);
export default MarkdownPlugin;
Defines a lazy plugin whose body is loaded on first enable.
The returned factory produces a stub
Pluginthat exposesmetasynchronously (so callers can readPlugin.meta.idfor free) but defers loading the real plugin's modules until the manager callsPlugin.resolveLazy. This lets the plugin's main entry point ship as a tiny meta-only chunk — the heavy capabilities, schema, React surfaces, etc. live behind the dynamicimport()and become a separate Rollup chunk that is only fetched when the plugin is enabled.