@mora/tinypng
Version:
基于 tinypng 封装的一个支持 `nodejs`、`命令行`和`webpack`的图片压缩工具
25 lines (24 loc) • 680 B
TypeScript
import { default as Tinypng, ITinypngOption } from './tinypng';
export interface IWebpackModule {
dependencies: any[];
context: string;
request: string;
userRequest: string;
rawRequest: string;
resource: string;
fileDependencies: any[];
assets: any;
cacheable: boolean;
}
export declare type IFilter = (m: IWebpackModule) => boolean;
export interface ITinypngWebpackOption extends ITinypngOption {
filter?: IFilter;
quiet?: boolean;
}
export default class TinypngWebpackPlugin {
options: ITinypngWebpackOption;
tp: Tinypng;
filter: IFilter;
constructor(options: ITinypngWebpackOption);
apply(compiler: any): void;
}