webpack-inject-plugin
Version:
A webpack plugin to dynamically inject code into the bundle.
27 lines (26 loc) • 895 B
TypeScript
import { Compiler, Entry, EntryFunc } from 'webpack';
declare type EntryType = string | string[] | Entry | EntryFunc;
declare type EntryFilterFunction = (entryName: string) => boolean;
declare type EntryFilterType = string | EntryFilterFunction;
export declare type Loader = () => string;
export declare const registry: {
[key: string]: Loader;
};
export declare enum ENTRY_ORDER {
First = 1,
Last = 2,
NotLast = 3
}
export interface IInjectOptions {
entryName?: EntryFilterType;
entryOrder?: ENTRY_ORDER;
loaderID?: string;
}
export declare function injectEntry(originalEntry: EntryType | undefined, newEntry: string, options: IInjectOptions): EntryType;
export default class WebpackInjectPlugin {
private readonly options;
private readonly loader;
constructor(loader: Loader, options?: IInjectOptions);
apply(compiler: Compiler): void;
}
export {};