content-injector-webpack-plugin
Version:
A flexible Webpack plugin for injecting dynamic content (e.g., version, timestamps) into build assets with precise file matching and position control.
22 lines (21 loc) • 731 B
TypeScript
import { Compiler } from 'webpack';
interface PluginOptions {
match?: RegExp | ((filename: string) => boolean);
include?: RegExp | string | ((filename: string) => boolean);
exclude?: RegExp | string | ((filename: string) => boolean);
position?: 'head' | 'tail';
content: string | (() => string) | ((hash: string) => string);
injectHash?: boolean;
hashAlgorithm?: string;
hashLength?: number;
}
declare class ContentInjectorWebpackPlugin {
private options;
constructor(options: PluginOptions);
apply(compiler: Compiler): void;
private getFileHash;
private validateFilename;
private matchCondition;
private shouldProcessFile;
}
export default ContentInjectorWebpackPlugin;