接口: TemplateHooks
为了让其他插件能够修改 template,此插件会执行 tapable 钩子。
示例
属性
afterEmit
afterEmit:
AsyncSeriesWaterfallHook<{outputName:string; }>
Alpha
在 template 输出后调用。
asyncChunkName
asyncChunkName:
SyncWaterfallHook<string>
Alpha
获取异步 chunk 的真实名称。具有相同 asyncChunkName 的文件会被放入同一个 template。
beforeEmit
beforeEmit:
AsyncSeriesWaterfallHook<{chunkGroups:ChunkGroup[];cssChunks:Asset[];cssDiagnostics?:string;debugInfo:string;finalEncodeOptions:EncodeOptions;mainThreadAssets:Asset[];outputName:string;template:Buffer; }>
Alpha
在 template 输出前调用,可用于修改 template。
beforeEncode
beforeEncode:
AsyncSeriesWaterfallHook<{chunkGroups:ChunkGroup[];encodeData:EncodeRawData;filenameTemplate:string;intermediate:string;intermediateAssets:string[]; }>
Alpha
在编码流程开始前调用,可用于修改编码选项。
encode
encode:
AsyncSeriesBailHook<{encodeOptions:EncodeOptions;intermediate?:string; }, {buffer:Buffer;cssDiagnostics?:string;debugInfo:string; }>
Alpha
调用编码流程。