@roots/entrypoints-webpack-plugin
Version:
Manifest with assets grouped by entrypoint
60 lines (59 loc) • 1.46 kB
TypeScript
import type { CompilationHooks, Entrypoints, Options } from '@roots/entrypoints-webpack-plugin';
import type { WebpackPluginInstance } from 'webpack';
import Webpack from 'webpack';
/**
* Produces `entrypoints.json` artifact with compiled assets broken down
* by entrypoint and then filetype.
*
* {@link WebpackPluginInstance}
*
* @example
* ```js
* import {EntrypointsWebpackPlugin} from '@roots/entrypoints-webpack-plugin'
*
* const config = {
* plugins: [new EntrypointsWebpackPlugin()]
* }
* ```
*/
export declare class EntrypointsWebpackPlugin implements WebpackPluginInstance {
options: Options;
/**
* Get compilation hooks
*
* @param compilation
* @returns
*/
static getCompilationHooks(compilation: Webpack.Compilation): CompilationHooks;
/**
* Collected assets
*/
entrypoints: Entrypoints;
/**
* Plugin compiler ident
*/
protected plugin: {
name: string;
stage: number;
};
/**
* Class constructor
*/
constructor(options: Options);
addToManifest({ ident, path, type, }: {
ident: string;
path: string;
type: string;
}): void;
/**
* {@link WebpackPluginInstance.apply}
*/
apply(compiler: Webpack.Compiler): void;
/**
* Get assets from an entrypoint
*/
getFilesFromChunks(chunks: Webpack.Chunk[]): Array<{
file: string;
ident: string;
}>;
}