import type { Asset, Compilation, Compiler } from 'webpack'; import type { AssetData, FilesDependencies, Manifest, PluginOptions, PublicPath, TemplateFunction } from './types.js'; export default class ChunksWebpackPlugin { options: PluginOptions; /** * Instanciate the constructor * @param options Plugin options */ constructor(options?: Partial); /** * Apply function is automatically called by the Webpack main compiler * @param compiler The Webpack compiler variable */ apply(compiler: Compiler): void; /** * Hook expose by the Webpack compiler * @async * @param compilation Webpack compilation */ hookCallback(compilation: Compilation): Promise; /** * Add assets * The hook is triggered by webpack * @async * @param compilation Webpack compilation * @returns */ addAssets(compilation: Compilation): Promise; /** * Get SVGs filtered by entrypoints * @param options * @param options.compilation Webpack compilation * @param options.entryName Entrypoint name * @returns Svgs list */ getFilesDependenciesByEntrypoint({ compilation, entryName }: { compilation: Compilation; entryName: string; }): FilesDependencies; /** * Get the public path from Webpack configuation * and add slash at the end if necessary * @param compilation Webpack compilation * @return The public path */ getPublicPath(compilation: Compilation, entryName: string): PublicPath; /** * Get assets data * File path for the manifest * HTML tags for the generated files * @param options * @param options.templateFunction Template function to generate HTML tags * @param options.assets Asset module * @param options.entryName Entry name * @param options.publicPath Public path generated * @returns */ getAssetData({ templateFunction, assets, entryName, publicPath }: { templateFunction: TemplateFunction; assets: Asset[]; entryName: string; publicPath: PublicPath; }): AssetData; /** * Create chunks manifest with Webpack compilation * Expose the manifest file into the assets compilation * The file is automatically created by the compiler * @async * @param options * @param options.compilation Webpack compilation * @param options.cache Webpack cache * @param options.eTag Webpack eTag * @param options.manifest Manifest * @returns Sprite filename */ createChunksManifestFile({ compilation, cache, eTag, manifest }: { compilation: Compilation; cache: any; eTag: any; manifest: Manifest; }): Promise; }