@roots/entrypoints-webpack-plugin
Version:
Manifest with assets grouped by entrypoint
47 lines (46 loc) • 1.45 kB
TypeScript
import type { Entrypoints } from '@roots/entrypoints-webpack-plugin';
import Webpack from 'webpack';
/**
* Emits inline html for each entrypoint
*/
export declare class HtmlEmitter {
compilation: Webpack.Compilation;
assets: Webpack.Compilation[`assets`];
entrypoints: Entrypoints;
publicPath: string;
/**
* Class constructor
*
* @param compilation - webpack compilation
* @param assets - webpack compilation assets
* @param entrypoints - {@link Entrypoints}
* @param publicPath - asset publicPath
*/
constructor(compilation: Webpack.Compilation, assets: Webpack.Compilation[`assets`], entrypoints: Entrypoints, publicPath: string);
/**
* Reduce entrypoint entrypoints to markup
*
* @returns void
* @decorator bind - {@link bind}
*/
emit(): void;
/**
* Get compiled asset file contents
*
* @param ident - asset module name
* @returns - asset file contents
*/
getCompiledAsset(ident: string): string;
/**
* Reduce a js filename to markup
*/
makeScript(attributeRecords: Record<string, boolean | string | undefined>, inner?: null | string): string | undefined;
/**
* Reduce a script from entry item to markup
*/
scriptReducer(acc: string, src: string): string;
/**
* Reduce a stylesheet from entry item to markup
*/
styleReducer(acc: string, href: string): string;
}