For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /api/template-webpack-plugin.templatehooks.beforeemit.md.
This is the dev preview website. Check out the document at lynxjs.org

Home > @lynx-js/template-webpack-plugin > TemplateHooks > beforeEmit

TemplateHooks.beforeEmit property

This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Called before the template is emitted. Can be used to modify the template.

Signature:

beforeEmit: AsyncSeriesWaterfallHook<{
        finalEncodeOptions: EncodeOptions;
        debugInfo: string;
        cssDiagnostics?: string;
        template: Buffer;
        outputName: string;
        mainThreadAssets: Asset[];
        cssChunks: Asset[];
        chunkGroups: ChunkGroup[];
    }>;